Node.js
nvm CLI
nvm commands for Node.js version management.
27 commands
Windows
MacOS
Linux
#version-manager
#javascript
Installation
Install the latest Node.js 20.x release
nvm install 20
Install the latest LTS version
nvm install --lts
Install the latest current version
nvm install node
Install a specific Node.js version
nvm install 20.11.0
Uninstall a specific version
nvm uninstall 18.19.0
Version Management
List all locally installed versions
nvm ls
List all available remote versions
nvm ls-remote
List only LTS versions available
nvm ls-remote --lts
Show the currently active version
nvm current
Show the nvm version installed
nvm version
Show the path to a specific version
nvm which 20
Aliases
Set default Node.js version
nvm alias default 20
Create a custom named alias
nvm alias myproject 18.19.0
Remove a custom alias
nvm unalias myproject
List all defined aliases
nvm alias
Usage
Switch to Node.js 20.x in current shell
nvm use 20
Switch to the latest LTS version
nvm use --lts
Switch to the latest installed version
nvm use node
Switch to system-installed Node.js
nvm use system
Run a command with a specific version
nvm exec 18 node app.js
Run node with a specific version
nvm run 20 --version
Configuration
Upgrade npm to the latest for current node
nvm install-latest-npm
Reinstall global packages from another version
nvm reinstall-packages 18
Clear the nvm download cache
nvm cache clear
Quick Commands
Install the latest Long Term Support version of Node.js
nvm install --lts
Switch the current shell to use Node.js version 20.x
nvm use 20
Set the default Node.js version for new shell sessions
nvm alias default 20