Node.js – Debug node js with Visual Studio Code

debuggingexpressnode.jsvisual-studio-code

I try to debug a Project in node JS with Visual Studio Code but i don't achieve.
I have built a simple project with the next commands:

express myExpressApp
cd myExpressApp
npm install
npm
start

My file launch.json:

enter image description here

I select the Option “Launch app.js” in Window “Debug”. The application run without problems. I put a breakpoint:

enter image description here

I give in Chrome the address: http://localhost:3000/

Visual Studio Code says: “Pause on breakpoint”, but I don't see anything, I can press Continue and the application continues…

Pause on breakpoint

Edited: I use OS X 10.10 (I tested it and it works perfectly in Ubuntu.)

Best Answer

VSCode 0.8.0 has problems with node versions older than 0.12.0. Upgrade to at least 0.12.0 or wait for the upcoming VSCode 0.9.0.