How To Install Multiple Version Of Node.js

Jan 30, 2018

There is a few options for Node Version Manager or Virtual Envionment, below is their stats as of 28 Jan 2018.

NameGithub StarIssuesLast Release
nvm24401179Dec 13, 2017
n852676Dec 30, 2015
nave11102Feb 14, 2017

Obviously I choose nvm.

Install nvm.

NOTE: installation with curl & bash is pretty scarry and dangerous, always skim through the file first.

curl -o- | bash

Close the current terminal and open a new terminal (to execute the startup script added to ~/.bashrc)

Check if nvm is installed properly.

command -v nvm

Install latest Node.js

nvm install node# Downloading and installing node v9.4.0...

Install latest Node.js LTS.

nvm install --lts# Installing latest LTS version.# Downloading and installing node v8.9.4..

Check current node version

nvm current # OR node -v

List all installed node version

nvm ls#          v8.9.4#          v9.4.0# ->       system# default -> system

Set system node (node installed at OS level, outside of nvm) as defaut

nvm alias default system

Set specific version as default

nvm alias default 8.9.4

Set current node to default version

nvm use default

Set current node to use system node

nvm use system

Set current node to specific version.

nvm use 8.9.4

Set curent node to latest LTS.

nvm use node --lts

Deactivate nvm.

nvm deactivate


❤️ Is this article helpful?

Buy me a coffee ☕ or support my work via PayPal to keep this space 🖖 and ad-free.

Do send some 💖 to @d_luaz or share this article.

✨ By Desmond Lua

A dream boy who enjoys making apps, travelling and making youtube videos. Follow me on @d_luaz

👶 Apps I built

Travelopy - discover travel places in Malaysia, Singapore, Taiwan, Japan.