Skip to content

Node.js Node Version Manager (nvm)

Node Version Manager (in short nvm) is is a version manager for node.js, designed to be installed per-user, and invoked per-shell. nvm works on any POSIX-compliant shell (sh, dash, ksh, zsh, bash), in particular on these platforms: Unix, macOS, and windows WSL.

All documentation for NVM can be found in Github.

Available versions:

To show available versions:

nvm ls-remote

Installing

To install a specific version:

nvm install v13.10.0

Checking version

To test afterward:

jackie_mm@svc-magetest-cf:~$ node -v
v14.2.0
jackie_mm@svc-magetest-cf:~$ npm -v
6.14.4

Switching versions

To switch through installed versions nvm provides the nvm use command. This works similarly to the install command. So, you need to follow this by a version number or an alias.

Switch to Node.js version 13.6.0:

nvm use 13.6.0

Switch to Node.js version 12.14.1:

nvm use 12.14.1

Switch to the latest Node.js version (our system detects and always use latest one by default):

nvm use node

Switch to the latest LTS version:

nvm use --lts

See versions installed

To list what is already installed on server:

nvm ls

Output:

When switching to a different version, nvm will make the node instance in your terminal symlink to the proper Node.js instance.