Nodejs Debugging Tips

Source: Internet
Author: User

1, command-line debugging

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 expression expr to watch list
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

2, TCP debugging

$ node--debug-brk debug.js
Debugger listening on port 5858


$ node Debug 127.0.0.1:5858
Connecting ... ok

Nodejs Debugging Tips

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.