Search code examples
node.jsvisual-studio-codevscode-debuggernvm

VS Code - 'runtimeVersion' error prompt when debugging is started


Trying to Debug with following launch configuration on VS Code upon which I get a prompt that need to install NVM or NVS.

{
// 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",
        "name": "vscode-jest-tests",
        "request": "launch",
        "program": "${workspaceFolder}/node_modules/.bin/jest",
        "args": [
            "--runInBand"
        ],
        "envFile": "${workspaceFolder}/.env",
        "cwd": "${workspaceFolder}",
        "console": "integratedTerminal",
        "internalConsoleOptions": "neverOpen",
        "disableOptimisticBPs": true
    },
    {
        "type": "node",
        "request": "launch",
        "name": "Launch Program",
        "skipFiles": [
            "<node_internals>/**"
        ],
        "program": "${workspaceFolder}/src/index.ts",
        "preLaunchTask": "npm: build",
        "outFiles": [
            "${workspaceFolder}/**/*.js"
        ],
        "envFile": "${workspaceFolder}/.env",
        "resolveSourceMapLocations": [
            "${workspaceFolder}/**",
            "!**/node_modules/**"
        ],
        "runtimeVersion": "10.16.3"
    }
]

}

enter image description here

I have both NVM and NVS Installed.

OS - MacOS 11.6 NVM Version - 0.38.0 Node version - 10.16.3 VS Code Version - Version: 1.60.2 (Universal)


Solution

  • Found that the .nvmrc file was missing.

    Resolved once the nvmrc file is created and node version is updated in the file