Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Node-Inspector not starting

First, I was having an issue installing node-inspector, I had to revert to installing version @0.7.5.. That installed globally on my machine, but now when I try to run node-inspector I get the error below. I find it odd that I haven't been able to find much in regards to these two errors.

module.js:487
    throw err;
    ^
Error: Cannot find module '_debugger'
    at Function.Module._resolveFilename (module.js:485:15)
    at Function.Module._load (module.js:437:25)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/node-inspector/lib/debugger.js:2:16)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
like image 457
gemart Avatar asked Jun 20 '17 20:06

gemart


People also ask

How do I run a Node in debug mode?

Open up Preferences > Settings and in the search box type in “node debug”. Under the Extensions tab there should be one extension titled “Node debug”. From here, click the first box: Debug > Node: Auto Attach and set the drop down to “on”. You're almost ready to go now.

How do I inspect Node js in Chrome?

Using Google Chrome DevTools to Debug The next step is to head to Chrome, open a new tab, and enter the URL chrome://inspect/ . Click on “Open dedicated DevTools for Node” to start debugging the application. It will take a couple of seconds to view the source code in Chrome DevTools.

What is inspector in Node JS?

Inspector in node. js is a debugging interface for node. js application that is contained in the app. js file and used blink developer tools. It works almost similar to chrome developer tools.


1 Answers

I was facing the same issue today. After some googling I found that is deprecated now. Use instead this:

node --inspect-brk yourScript.js

Head over to Official Docs for complete reference.

After running the above command, do either of the following two options:

Option 1: Open chrome://inspect in a Chromium-based browser. Click the Configure button and ensure your target host and port are listed. Then select your Node.js app from the list.


Option 2: Install the Chrome Extension NIM (Node Inspector Manager): https://chrome.google.com/webstore/detail/nim-node-inspector-manage/gnhhdgbaldcilmgcpfddgdbkhjohddkj

Hope that helps!

like image 114
Umar Tahir Avatar answered Nov 11 '22 13:11

Umar Tahir