Write a Nodejs small application, found the classmate write server-side debugging method, toss with the next Chrome debugging, also good.
We write JS code debugging when the general use of Google Browser built-in Debugging tools, NODEJS program can also be debugged like this, but first need to install a node-inspector:
This needs to be installed with NPM, just execute the following statement:
NPM install-g Node-inspector
After the installation is complete, you can usually start it directly in the background, remembering that there are no spaces between node and '-':
Node-inspector &
The default is to listen on port 8080 and, of course, it may be modified by using the--web-port parameter. Then, when executing the node program, add a parameter:--DEBUG-BRK, as follows:
Node--debug-brk app.js
The console will return "debugger listening on port 5858", now open the browser, visit http://127.0.0.1:8080/debug?port=5858, this time will open a very like chrome built-in debugging tool interface , you can use this to debug it below.
Today, the commissioning of the next Nodejs