Debugging your node application using the Chrome Dev-Tools interface

We can make use of the power of Chrome Dev-Tools for debugging your node applications. NPM has module  for that called ‘node-inspector’.

Node allows a remote debugging by exposing a debugging port that third-party modules and tools can hook into (including the built-in debugger).  And node-inspector makes use of it. It ties the debugging information from Node into the Chrome DevTools interface.

To set up node-inspector, simply install it(globally):

npm install node-inspector -g

Now we can fire it up by running following command:

node-inspector

Now node-inspector is ready to roll and will tell you where to reach it(URL). Browse it to it with Chrome.

Now just run your application with:

node --debug appName.js

But this debugger doesn’t automatically break on the first expression. To enable that you have to run following command.

node --debug-brk appName.js
 


One Comment on “Debugging your node application using the Chrome Dev-Tools interface”


Leave a comment