debugging Node.js App with Chrome dev tools!
the main branch is the most current again as of Aug 20th 2013
there are also updates to the readme that include a lot what I wrote below:
1. install node-inspector
npm install -g node-inspector
2. don’t use port 8080 in your node app (this port is used by node-inspector)***
3. start your app using
node --debug-brk app.js
this starts node in debugging mode with a break at line 1
4. start node inspector
node-inspector
this will output a url, open that url in your browser
5. use chrome debugging tools!!
notes:
you can use debugger or breakpoints as normal
no jasmine-node support…
this main app is no longer supported, and I suggest using the fork linked to above
autorestart node-inspector when you hit an error using these commands:
until node-inspector; sleep 1; done
*** if you want to use port 8080 for your node server you can change the port that node-inspector uses
--web-port=[port] port to host the inspector (default 8080)
**** Updated from:
as of july 2013 this fork is the best: strongloop/node-inspector
Thanks to Jake for posting this code in the comments!
What do you mean that