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!