Chrome-based nodejs debugger usage and chromenodejs Debugger

Source: Internet
Author: User

Chrome-based nodejs debugger usage and chromenodejs Debugger

I have been learning nodejs for a long time. Unfortunately, I have never insisted on it. I have always wanted to use the express framework of nodejs with mysql to develop a small website. The user registration function has not yet been implemented. This is to be continued. Teachers who are willing to help me ~ I am not very grateful to see my article guiding the younger generation...

To sum up the debugging of nodejs in chrome:

After reading a lot of information and guidance, nodejs provides such a module node-inspector. Let's install it in one sentence:


Npm install-g node-inspector //-g is global installation


Before debugging, Start node-inspector to listen to the debug debugging port of nodejs.

Open the nodejs command box and run it with the Administrator permission. Enter the following sentence:

Node-inspector


If start debugging appears, it will be OK. The port listens to port 8080 by default.

Then we start our nodejs program and run the command -- debug or -- debug-brk, for example, my:


I started it with the supervisor. The advantage is that you don't need to restart the program after you modify the program. The supervisor automatically listens to the program for you and starts it when needed.

For more information, see click To open a connection. You can also use node to start the connection.

When we see the above picture, we can debug it.

Run the nodejs program, enter the startup address in the browser, and then open a window and enter http: // localhost: 8080/debug? Port = 5858

Appears:


You can start debugging!


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.