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 different projects.
Even though I can change from terminal with nvm, VS Code uses default version. I need to change the default version every time and completely restart the VSCode. Is there a way to alter configuration so it picks up the version I wanted both for in-app terminal and for running project?
Once you have your launch configuration set, start your debug session with F5. Alternatively, you can run your configuration through the Command Palette (Ctrl+Shift+P) by filtering on Debug: Select and Start Debugging or typing 'debug ' and selecting the configuration you want to debug.
To set Visual Studio debugger options, select Tools > Options, and under Debugging select or deselect the boxes next to the General options. You can restore all default settings with Tools > Import and Export Settings > Reset all settings.
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"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With