Visual Studio Code to use node version specified by NVM

后端 未结 17 1236
渐次进展
渐次进展 2020-12-07 16:01

Is it possible for VS Code to use node version specified by NVM?

I have 6.9.2 installed locally. Even after switching to another version, from the OS X terminal (no

17条回答
  •  难免孤独
    2020-12-07 17:03

    In VS Code, go to your launch.json file and add the runtimeVersion attribute inside configurations, as shown below. (In this example, we are assuming 4.8.7 is already installed using nvm)

    {
    "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"
        }
    ]}
    

提交回复
热议问题