简体   繁体   中英

vscode - cannot debug express-generator project

I want to speed up development by learning to debug my programs in Visual Studio Code. I had been following the vsCode docs but ran into a snag.

I used Express (v4.16.0) to generate a plain project and added the default Node.js (v8.11.3) debug configuration to Visual Studio Code (v1.25.1)

Launching the Visual Studio Code debugger and going to the link it is listening on yields a loading blank page.

Here is a GitHub repository of the project.

When I begin debugging, vsCode prints to the debug console Debugger listening on ws://127.0.0.1:3804/123e990c-24a1-475c-beff-039206890946 . I would navigate there thinking that was the new address of my project. It is not.

The address of my project is still what I specified in Express, localhost:3000 . Navigating there after starting the vsCode debugger does trigger my break points and allow me to navigate my application.

sigh

{
    "type": "node",
    "request": "launch",
    "name": "Launch",
    "program": "${workspaceRoot}/bin/www"
}

change the value in program key

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM