How to debug a Nodejs project in VSC

Jeremie LitzlerLess than 1 minuteWeb developmentGuidesNodeJSVisual Studio CodeConfigure IDE

Debugging is the life of any developper. It allows you to check when your code doesn't behave... because you gave it the wrong instructions.

Let's dive into how to enable it in Visual Studio Code. It will be quick.


How to enable debugging

It can be found of the official Visual Studio Code websiteopen in new window.

Step 1

Create a new JavaScript Debug Terminal
Create a new JavaScript Debug Terminal

Step 2

Run the command to run your application, in my case:

npm run dev

You should see this:

A running debugger
A running debugger

Photo by C Mopen in new window on Unsplash.