To install node-inspector with NPM, fire up a terminal and enter the following
$npm install -g node-inspector
After that you’ll need to start your application in debug mode. If you have a nodejs application that starts fine and want to attach the debugger after starting use the following:
$node --debug yourApplication.js
If however your application does NOT start properly or ends before you have time to attach the debugger, use the following to start your application:
$node --debug-brk yourApplication.js
This will not start the application yet, but wait till you’re ready to push the “run” button in the interface.
Now that the application is running, it’s time to start node-inspector