Wednesday, 1 June 2016

nodejs debug


Debug on command line:
https://nodejs.org/api/debugger.html


Debug on chrome with nice source code and break points support:

Node Inspector

https://github.com/node-inspector/node-inspector

after you run "node-debug app.js"

It will open a new chrome window for you and stop the app at the first line of your code.

Then you need let the code run from the broken point.

This is a perfect tool to debug, expect i always get this error:

Runtime.getProperties failed.
ReferenceError: frame_index is not defined


When you finished your debug, you should close the new chrome window totally, if you use mac, make sure you use "cmd+q" to kill the window. otherwize you next debug will not able to open the debug window for you.

Devtool

https://github.com/Jam3/devtool

devtool got a very rubbish ui for sourcecode:



No comments:

Post a comment