Native Debug Node Debug app.js
- Step Node Debug App.js
Table 3-3 node. js Debug command
Command function
Run executes the script, pausing on the first line
Restart re-executing the script
Cont, C continues execution until the next breakpoint is encountered
Next, N Single Step execution
Step, s stepping into function
Out, O step out of the function
Setbreakpoint (), SB () set a breakpoint on the current line
Setbreakpoint (' F () '), SB (...) set a breakpoint on the first line of function f
Setbreakpoint (' Script.js '), SB (...) set a breakpoint on line 20th of Script.js
Clearbreakpoint, CB (...) Clear all breakpoints
BackTrace, BT displays the current call stack
List (5) shows the front and back 5 lines of code that are currently executing
Watch (expr) joins the expression expr to the watch list---the value of some variables is not displayed on this computer, and I don't know why
Unwatch (expr) to remove expression expr from the watch list
Watchers display all expressions and values in the watch list
REPL Open an immediate evaluation environment in the current context
Kill terminates the currently executing script
Scripts show all scripts that are currently loaded
Version shows the versions of V8
Eclipse Plugin Debug NPM package node-inspector Debug
- NPM install-g Node-inspector (which requires vs compilation, if vs2012 is installed, set the compiled vs version, otherwise it might compile.) NPM config set msvs_version--global)
- Start App.js:node--debug-brk=5858 App.js, where the port number can be modified
- Start Node-inspector:node-inspector--web-port=8000--web-host=192.168.39.129--debug-port=5858 &, where 5858 is consistent with the previous article, Web-port is the Web port that is started, Web-host is the IP address of the Web that is started. Remote debugging can be implemented.
- Open Google Chrome, enter the address http://192.168.39.129:8000/debug?port=5858 to debug
vs2012 or vs2013 plug-in debugging
After installing Ntvs 1.0 Beta 2 VS 2012, vs2012 will support creating a node project and debugging.
Webstorm Commissioning
Webstrom comes with node project support.