How to Debug Node.js Backend Server in VS Code

Before we start, I will use Express to demonstrate this tutorial.

First, we have to init express project.

mkdir express-debugger
cd express-debugger
npm init
npm install express

Create index.js in a directory and paste the following code.

Now you should have a project like this.

Then it is very simple you click in front of the line number in the editor. Then click the debugger icon on the left panel and click JavaScript Debug Terminal.

You will get an integrated terminal below and it’s labeled as a JavaScript Debug Terminal.

Then start the node server.

node index.js

Split open another terminal and send a request to the server. I use curl to send requests.


'http://localhost:3000'

curl -X GET \

Congratulations! You can debug on the Node backend server right now.

Thank you for reading and enjoy your coding.

More content at plainenglish.io. Sign up for our free weekly newsletter. Get exclusive access to writing opportunities and advice in our community Discord.