简体   繁体   中英

WSL2/Ubuntu Debugging in Node.js Broken After Updating Visual Studio Code to 1.6.3

I have an existing node.js express project that I was able to debug using WSL2 on Windows 10 in Visual Studio Code by just highlighting my app's entry point file (app.js) and hitting F5. After I installed an update to VSC yesterday (now on 1.6.3), F5 no longer does anything but flash up the debug toolbar briefly. Breakpoints aren't hit. No messages are output. Any ideas on how to get this working again?

PS I'm still able to debug using VSC directly in Windows, but WSL2/Ubuntu doesn't work. I tried creating a simple project from scratch in both.

I was able to get this working by adding a.vscode/launch.json file. Prior to upgrading, I did not need this file.

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "pwa-node",
            "request": "launch",
            "name": "Launch Program",
            "skipFiles": [
                "<node_internals>/**"
            ],
            "program": "${workspaceFolder}/index.js",
            "runtimeVersion": "14.17.4",
            "trace": true,
        }
    ]
}

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