VS Code, change NodeJS version for debugger

后端 未结 1 1313
刺人心
刺人心 2021-02-12 23:02

I want to change NodeJS version from 4.5.0 to 7.7.2 for VS Code specifically for different projects. I am using nvm on Mac, and I have two versions stated above. They are for di

1条回答
  •  臣服心动
    2021-02-12 23:17

    After VS Code 1.21, there is a better solution than the original answer.

    You can set "runtimeVersion": "7.7.2" and if you have nvm/nvs installed, it will be able to find that version of Node. Details: https://code.visualstudio.com/updates/v1_21#_node-debugging

    --- Original answer ---

    In your launch config, you can set a path to a Node executable from nvm like this: "runtimeExecutable": "/Users/me/.nvm/versions/node/v7.7.1/bin/node"

    0 讨论(0)
提交回复
热议问题