Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you get node-inspector to work?

Tags:

node.js

Install:

npm install node-inspector

Run app:

node --debug-brk c:\users\me\desktop\myapp.js // app stops successfully

Run inspector:

node-inspector // doesnt work.
C:\Users\me\node_modules\.bin\node-inspector // does work.

Open chrome or safari and make sure debugger is on and navigate to localhost:5858. But this releases the app from the breakpoint and it doesn't show up anywhere inside chrome or safari.

enter image description here

Solution:

enter image description here

like image 208
user1873073 Avatar asked Jan 14 '13 07:01

user1873073


People also ask

Which command is used to install node inspector?

Run a cmd, enter the folder and type npm install . Type npm install node-inspector again.

How do I debug node in Chrome?

Using Google Chrome DevTools to Debug To start debugging, let's run our application with the --inspect-brk flag. 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.


1 Answers

Go directly to http://​localhost:8080.

Port 5858 is the port that node-inspector uses to communicate with your node process; you don't access it directly. It speaks V8's raw debugging protocol.

inspector talks to your process via that protocol and serves up a HTTP website on 8080.

Also, npm should have put C:\Users\me\node_modules\.bin\ in your PATH. You might need a reboot for that to take effect, after which you should be able to just type node-inspector at a command prompt (rather than typing the whole path).

like image 155
josh3736 Avatar answered Oct 06 '22 00:10

josh3736