Debugging node.js code is easy using https://github.com/node-inspector/node-inspector.
For windows users the read me lists some fairly complex steps. I have been able to debug my nodejs code using node-inspector by just running a batch that contains these three start commands:
start "" /D"." node --debug-brk app.js start "" /D"." node-inspector & start chrome http://127.0.0.1:8080/debug?port=5858
You start this in the folder that contains the js file you are debugging (app.js in this case) and you have to install the node-inspector before you can start debugging by calling the npm command below.
npm install node-inspector
You also need chrome for this to work 🙂