Nodejs debug using visual studio code

Asked

Viewed 191 times

2

I’m using Visual Studio Code and I’m not able to debug a nodejs for it.

If I put one breakpoint anywhere in my app.js and start debug, it works, but when I already have it in the browser and switch to another route, for example, nothing happens.
Updating the page while it is on the root route (/), also nothing happens. It’s only triggered the first time.

I’m starting now to use nodejs + visual studio code and would like to know if someone could guide me and explain how debug works.

2 answers

0


I ended up discovering that I was putting the breakpoint in the wrong place, causing it not to be triggered using Visual Studio Code.

I also tested the debug of Visual Studio Community 2015 with Nodejs support and it seemed a great use option for programming.

In this way, I find my doubt solved.

-1

If you want a solution with Node do the following, put Debugger, in code snippets and in the vscode terminal type the command:

Node Inspect filename.js

0

Function facaalgumthing(a+b) {

Debugger;

Return a+b; }

Let test = 0;

Debugger;

Browser other questions tagged

You are not signed in. Login or sign up in order to post.