1. Download the nvm
installation script from GitHub page by using curl
curl -sL https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh -o install_nvm.sh
bash install_nvm.sh
source ~/.profile
- Source the
~/.profile
file to gain access to thenvm
functionality - or you can just logout & login
$ nvm ls-remote
...
v12.0.0
v12.1.0
v12.2.0
v12.3.0
v12.3.1
v12.4.0
v12.5.0
v12.6.0
v12.7.0
v12.8.0
v12.8.1
v12.9.0
v12.9.1
v12.10.0
v12.11.0
v12.11.1
v12.12.0
v12.13.0 (LTS: Erbium)
v12.13.1 (LTS: Erbium)
v12.14.0 (LTS: Erbium)
v12.14.1 (LTS: Erbium)
v12.15.0 (LTS: Erbium)
v12.16.0 (LTS: Erbium)
v12.16.1 (LTS: Erbium)
v12.16.2 (LTS: Erbium)
v12.16.3 (Latest LTS: Erbium)
...
Install specific version
nvm install 12.14.0
Install the most recent LTS release
nvm install --lts
$ node -v
v12.14.0
or
$ node --version
v12.14.0
$ nvm ls
v10.15.1
-> v12.14.0
system
default -> 10.15.1 (-> v10.15.1)
node -> stable (-> v12.14.0) (default)
stable -> 12.14 (-> v12.14.0) (default)
iojs -> N/A (default)
lts/* -> lts/erbium (-> N/A)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.17.1 (-> N/A)
lts/carbon -> v8.17.0 (-> N/A)
lts/dubnium -> v10.20.1 (-> N/A)
lts/erbium -> v12.16.3 (-> N/A)
Switch to Node.js version
12.14.0
$ nvm use 12.14.0
Now using node v12.14.0 (npm v6.13.4)
Switch to the latest Node.js version
nvm use node
Switch to the latest LTS version
nvm use --lts
Specific version
nvm alias default 12.14.0
Latest Node.js version
nvm alias default node
+
nvm uninstall [NODE_VERSION]