Today, the commissioning of the next Nodejs

Source: Internet
Author: User

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

Related Article

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.