Skip to main content

Version Specifiers

Version specifiers are the tokens you pass on the command line when running operational commands. NVM resolves each specifier to a concrete Node.js release (or set of releases) before install, uninstall, switch, or cache work runs.

For constraint syntax used in project pinning files, see Version Selectors.

Specifier forms

FormExampleDescription
Latest releaselatestNewest available release from the mirror index.
Latest LTSltsMost recent LTS release.
Named LTS linelts/ironSpecific LTS codename.
User aliaslegacyCustom alias from nvm alias add.
Major only24Latest matching 24.x.x.
Major.minor24.1Latest matching 24.1.x.
Exact semver24.1.0, v24.1.0Specific version (optional v prefix).

Commands that accept specifiers

CommandNotes
nvm installOne or more specifiers per invocation.
nvm uninstallEach specifier is resolved before removal.
nvm useSets default; may install when missing (unless --local).
nvm rcCLI argument is a specifier; resolved version is written to the target file.
nvm alias addTarget argument is resolved to a concrete version at add time.
nvm cache addDownloads archives without installing.
nvm cache remove versionWith --all, each token is a major or major.minor prefix.

Resolution order is documented in Version Selectors.

Examples

# reserved aliases
nvm install lts
nvm use latest

# LTS codename
nvm install lts/iron

# partials
nvm install 24
nvm use 24.1

# user alias
nvm alias add stable 24.1.0
nvm use stable

# exact version
nvm uninstall 20.19.1
nvm cache add 22.14.0

# write resolved version to a project file
nvm rc 24.1.0