Chrome-based Nodejs debugger usage

Source: Internet
Author: User

It's been a long time studying Nodejs. Unfortunately has not persisted, thought to learn some. Always wanted to use the Nodejs Express framework with MySQL to develop a small web site, until now still do not implement user registration function. This is not until the end of it. There are willing to help my teacher ~ See my article can give guidance to the juniors will not be grateful ...

No more gossip, summarize the debugs under Chrome Nodejs:

Read a lot of information guide, NODEJS provides such a module node-inspector, first, a sentence to install it:


NPM install-g Node-inspector/g is a global installation


we start Node-inspector to listen to the debug debug port of Nodejs before commissioning

Open the Nodejs command box, preferably run with administrator privileges, enter this sentence:

Node-inspector


The start debugging is OK, the port is listening by default 8080.

Then we start our Nodejs program, with commands--debug or--DEBUG-BRK, like mine:


I started with supervisor, its advantage is to change things without restarting the program, Supervisor automatically help you listen to the program, when needed to start.

For more information click to open the connection you can also use node to launch.

Seeing the above picture shows that we can debug.

Run the Nodejs program, enter the startup address in the browser, and then re-open a window, enter http://localhost:8080/debug?port=5858

Appear:


You can start debugging!


Chrome-based Nodejs debugger usage

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.