Sitemap

Member-only story

Debugging NodeJS with Chrome Inspector (DevTools)

5 min readJan 4, 2019

--

For this article I’m running NodeJS v10.13.0 and Chrome v71.0.3578.98 (64-bit)

TL;DR

To enable NodeJS application to be inspect / debug by chrome, simply add “— inspect=0.0.0.0:9229” to your command line:

node — inspect=0.0.0.0:9229 index.js

it also work with nodemon:

nodemon — inspect=0.0.0.0:9229 index.js

note: the “—” is dash dash

Then, open the chrome inspector and click on the NodeJS icon, as below:

Find the source code on the repository below:

Introduction

How many NodeJS (and javascript) developers rely on console.log ? Well, I’m definitely one of them who get things done quickly with this “archaic” method of debugging — however in the end it speeds up some development.

My background is a C# Developer, which Visual Studio used to give me many powers to debug in runtime. Then I met Chrome a few years ago, which helped me a lot to debug some Javascript code and later on, when I joined the NodeJS world, VS Code made our life even easier.

--

--

Thiago Bernardes
Thiago Bernardes

Written by Thiago Bernardes

Focused on Human-Centered Design & working collaboratively with different areas, I combine the IT background with UX experience to create innovative solutions