Familiar with the browser JS debugging window

As a good beginning development engineers, master browser debugging is an essential skill, when we need to debug a certain period of js code, we usually debugging of f12 directly open the browser window, can the corresponding js code in the debug window on breakpoints, debug, also can monitor variable values, view function execution stack, the scope chain, These basic uses are not described in detail here and are not the focus of this article.

F12 Open the debugging window of the browser

Node. Js debug

Js debugging we should be familiar with, so now popular Node.js how to debug? Do I need to download a special debugging tool?

The answer: Chrome has its own Node.js debug window.

Here’s how to debug Node.js:

1. Enter chrome://inspect/# Devices in the browser address bar to open the browser developer Settings.

3. Debug a particular file using the node command: node –inspect-brk plus the debug file path. For example, node –inspect-brk F:\Desktop\server.js to debug server.js on the Desktop. The meaning of this command is to break the debugging point on the first line of JS.

Normally, you should see the file with the first line of the break point in the Node debug window that opens.

Next, we are more familiar with the debugging link. The debugging mode is the same as the JS debugging mode.