Debugging Your NodeJS Application
You can use the node-inspector. Run this command to install it via npm:
npm install -g node-inspector
Then you can debug your application using
The Github repository can be found here: https://github.com/node-inspector/node-inspector
You can also debug node.js natively by starting it like this:
node debug your-script.js
To breakpoint your debugger exactly in a code line you want, use this:
For more information see here.
In node.js 8 use the following command:
node --inspect-brk your-script.js
about://inspect in a recent version of Google Chrome and select your Node script to get the debugging experience of Chrome’s DevTools.