Node.js Node Version Manager
Node Version Manager (nvm) 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.
Documentation for NVM can be found in Github.
Helpful Commands
-
To show available versions:
$ nvm ls-remote
-
To install a specific version:
$ nvm install v13.10.0
-
To confirm installed versions:
$ node -v v14.2.0 $ npm -v 6.14.4
-
To switch through installed versions nvm provides the nvm use command. This works similarly to the install command.
For example, to switch to Node.js version 13.6.0:
$ nvm use 13.6.0
To switch to Node.js version 12.14.1:
$ nvm use 12.14.1
-
To switch to the latest Node.js version (our system detects and always use latest one by default):
$ nvm use node
-
To switch to the latest LTS version:
$ nvm use --lts
-
To list what is already installed on server:
$ nvm ls
When switching to a different version, nvm will make the node instance in your terminal symlink to the proper Node.js instance.