nvm use
Switch the default Node.js version.
Usage
nvm use <version> [flags]
Default subcommand when you pass a version directly (for example nvm use 24).
Subcommands
| Subcommand | Description |
|---|---|
| (default) | Set active version — this page. |
lts | Use the most recent LTS or a named LTS line. |
latest | Use the highest semver among installed versions. |
last | Use the previously active default. |
shim | Switch to shim operating mode. |
link | Switch to link operating mode. |
Arguments
| Argument | Required | Description |
|---|---|---|
<version> | Yes | Version specifier. May install when missing unless --local is set. |
Flags
| Flag | Short | Description |
|---|---|---|
--install | -i | Install the requested version if missing. Overrides auto_install=false. |
--no-install | -n | Do not install if missing. Overrides auto_install=true. |
--local | -l | Use latest installed match for a partial version. Never installs. |
Examples
nvm use 24
nvm use 24.2.0 --install
nvm use 24 --no-install
nvm use 24 --local
Sample output
Now using Node.js v24.1.0 by default.
Notes
- Stores the current default and updates
last_version. - In shim mode, a reshim runs after activation.
- In link mode,
.nodejspoints to the linked active runtime path.