Visual Studio Code to use node version specified by NVM

In VS Code:

  • go to your launch.json file
  • add the runtimeVersion attribute inside configurations as shown below

In this example, we are assuming 4.8.7 is already installed using nvm:

{
"version": "<some-version>",
"configurations": [
    {
        "type": "node",
        "runtimeVersion": "4.8.7", // If i need to run node 4.8.7
        "request": "launch",
        "name": "Launch",
        "program": "${workspaceFolder}/sample.js"
    }
]}

Leave a Comment