If you’re developing with node, and you’re not using node-inspector, you should start right now.
Getting started is a breeze:
$ npm install -g node-inspector
$ node --debug your/short/node/script.js
I like to start with a break on the first line.
$ node --debug-brk your/short/node/script.js
I created a short script so I don’t forget:
node --debug-brk $1
Interactive stack traces with TraceGL
Tracegl – interactive stack traces. (Worth every penny)
More Node debugging resources
- Node Debugger (Built in command-line debugger)
- Debugging Production Systems (video talk)
- DTrace Your Node.js JS (slides)
- node-panic – Instrumentation for debugging your JS code
- Node Segfault Handler – For debugging native code