node. JS Debugging

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.