Simplify your node versioning workflow with nvm
and this extension.
This extension simplifies nvm workflow by:
- Automatically running
nvm use
on each terminal opened when an.nvmrc
file exists in your workspace. Inspired by vscode-nvm - Providing a command input hook to choose a version of node to run tasks against
- To be able to pick different node versions, you must have nvm installed
- To have
nvm use
executed on terminal startup, you must have nvm installed along with a.nvmrc
file in your workspace
// launch.json for running version picker with defaults
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Jest Current File",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": ["--detectOpenHandles", "${relativeFile}"],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"runtimeExecutable": "${env:HOME}/.nvm/versions/node/${input:pickVersion}/bin/node"
}
],
"inputs": [
{
"id": "pickVersion",
"type": "command",
"command": "extension.node-version"
}
]
}
// launch.json for running version picker with specified nvm dir
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Jest Current File",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": ["--detectOpenHandles", "${relativeFile}"],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"runtimeExecutable": "${env:HOME}/.nvm/versions/node/${input:pickVersion}/bin/node"
}
],
"inputs": [
{
"id": "pickVersion",
"type": "command",
"command": "extension.node-version",
"args": {
"nvmDir": "/my/home/.nvm"
}
}
]
}