


Each build goes in a subdirectory based on the remote name, semantic version, and architecture, for example node/6.7.0/圆4. NVS downloads node builds under the directory specified by the NVS_HOME environment variable, or under the NVS tool directory if NVS_HOME is not set. But all the code for querying available versions, downloading and installing node and matching npm, switching versions/architectures/engines, uninstalling, parsing and updating PATH, and more can be written in JavaScript, and mostly in a cross-platform way. Besides bootstrapping, the shell scripts are also used to export PATH changes to the calling shell (which a separate node process cannot do). The bootstrap code is just a few dozen lines each of Windows command script, Windows powershell script, and POSIX shell script. NVS uses a small amount of platform-specific shell code that bootstraps the tool by automatically downloading a private copy of node. (You may need to specify an absolute path such as "$/.nvs/nvs" if NVS is not in VS Code's PATH.)Įxample: Configure launch.json so VS Code uses NVS to launch node version 6.10: vscode located on the project's root folder), add a "runtimeArgs" attribute with an NVS version string and a "runtimeExecutable" attribute that refers to nvs.cmd (Windows) or nvs (Mac, Linux). Visual Studio Code can use NVS to select a node version to use when launching or debugging. NVS uses console-menu, a module originally written for this project then published separately. When invoked with no parameters, nvs displays an interactive menu for switching and downloading node versions. Refer to the docs for more details about each command. A version or filter consists of a complete or partial semantic version number or version label ("lts", "latest", "Argon", etc.), optionally preceded by a remote name, optionally followed by an architecture, separated by slashes.
