Skip to main content

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

SubcommandDescription
(default)Set active version — this page.
ltsUse the most recent LTS or a named LTS line.
latestUse the highest semver among installed versions.
lastUse the previously active default.
shimSwitch to shim operating mode.
linkSwitch to link operating mode.

Arguments

ArgumentRequiredDescription
<version>YesVersion specifier. May install when missing unless --local is set.

Flags

FlagShortDescription
--install-iInstall the requested version if missing. Overrides auto_install=false.
--no-install-nDo not install if missing. Overrides auto_install=true.
--local-lUse 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, .nodejs points to the linked active runtime path.