visual-studio-codedebuggingversion

Debug in VSCode stopped working when I changed node version


I've been running on vscode with node v20.9.0 for quite a while using debug for basic JS debugging. Today I needed to change to node v23.3.0 which required that I change nvm to v1.1.12. So I did all that and tested it out OK.

Running nvm list gives me:

  * 23.3.0 (Currently using 64-bit executable)
    20.9.0
    17.2.0

And I can go to the program that required node v23.3.0 and it runs properly where it didn't before.

But somehow I've lost debug configuration and capability.

When I pressed the bebug button I used to get three options along the left which I would use to start debug. That no longer happens, I have to use "F5" to start debug.

In the debug console it says:

C:\Program Files\nodejs\node.exe .\index.js

but nothing else. I see that the program is running though because it reacts with my other code, but I can't set breakpoints or otherwise do normal debugging. Also there is no "console.log" data shown in the console window.

My launch.json looks pretty basic:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "launch",
            "name": "Launch Program",
            "skipFiles": [
                "<node_internals>/**"
            ],
            "program": "${workspaceFolder}\\index.js",
            "cwd": "${workspaceRoot}"
        }
    ]
}

Solution

  • In the end, it was the new node version. Someone somewhere had mentioned that both v23.3.0 and v23.2.0 have the same problem.

    I had been using v23.3.0 and can vouch for that one having the problem, haven't tried v23.2.0, but yes, v23.1.0 works just fine!