I know how to debug http applications using node-inspector and iisnode. But can I use node-inspector to debug a non http node application, on windows?
I tried:
node debug test.js
It says:
debugger listening on port 5858
But opening http://localhost:5858/
in Chrome does not do anything.
BTW: running node debug test.js
does start the command-line debugger which works. But it's nothing like node-inspector.
To use node-inspector, the right switch is node --debug
not node debug
Here are the detailed steps:
npm install -g node-inspector
)node-inspector
http://localhost:8080/debug?port=5858
. You'll get the node-inspector UI but without any running app.--debug
switch like this: node --debug test.js
A few interesting points:
node --debug-brk test.js