środa, 24 października 2012

Debugging Node.js project under Windows

What is required to debug a Node.js project under Windows.

1) Installing node-inspector
- command line:
npm install -g node-inspector

2) Starting Node.js application AND node-inspector in the same time:
- assuming: app.js is a node.js application
- command line script (e.g. start.bat):
Taskkill /IM node.exe /F
(start /B node-inspector ) && (start /B node --debug app.js)

3) Checking out the result:

- assuming:  app.js starts at port 3000;
- node-inspector prints out IP and PORT
- for the webapp browse to:
- for debugger browse to (default values):