Node Version Manager (nvm)

Install & Update Script

To install or update nvm, you can use the following cURL or Wget command:

wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash

Troubleshooting

If you face any error command not found, then run the following commands for the different shells on the command line to fix the issue:

bash: source ~/.bashrc

zsh: source ~/.zshrc

ksh: . ~/.profile

Verify Installation

To verify that nvm has been installed, do:

command -v nvm

Usage

Downloading, compiling and installing the latest version of node, use the following commands:

nvm install node # "node" is an alias for the latest version

Installing specific version:

nvm install 14.7.0 # or 16.3.0, 12.22.1, etc

List available versions:

nvm ls-remote

Setting up default global version:

nvm alias default 14.7.0 #(specify the required version)