debug web application

Set breakpoints and debug node application with Chrome DevTools?

In this post, we are going to understand how to debug node application using chrome dev tools.

Step 1:  

Please make sure you are running node application on node version greater than 6.3. If you are using lower version, you can update your node to the higher version.

Step 2:

Usually, we will run our node application as node index.js and now we need to use inspect flag while running.

node --inspect index.js
$ node --inspect index.js 

Debugger listening on port 9229.

Warning: This is an experimental feature and could change at any time.

To start debugging, open the following URL in Chrome:


When you run your application using –inspect flag, we will get chrome-devtools URL, Please copy & paste the URL in chrome browser to start debugging.

Step 3:

Open chrome://inspect URL in the Chrome browser. You can able to find your application on the remote target section.

Step 4:

Open the debugging URL in the Chrome browser, we can able to find the node source code in the browser.

In the source tab, we can able to find the total source code of the application. Now we can set breakpoints and debug your application.

In the above example breakpoint set on line number 7. Hit http://localhost:3000/ in another tab and code will break in the application line number 7.

Want to know more about node debugging check out node.js docs.

Node debugger application will run on default port 9299 and if you want to change the port you can use the following command –inspect=port. Make sure port is available.

If you are using the lower version of node, try to use node-inspect module for debugging. However, it is preferred to use inbuilt version available with node.

If you enjoyed this article, please share with your developer friends.