- Make sure your Linux distro is up to date by running
sudo apt update && sudo apt upgrade
. - Install cURL by running
sudo apt-get install curl
- Install NVM by running
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
- Verify NVM installation by running
command -v nvm
- Check the available versions of Node JS by running
nvm ls available
- Install the latest release of Node JS by running
nvm install node
- Install the long-term support version by running
nvm install --lts
- Install a specific version by running
nvm install <version number>
. For example,nvm install 14.20.0
- Verify the installation by running
node --version
ornode -v
- Check the versions of Node installed locally by running
nvm ls
- To use a specific version of Node JS, run
nvm use <version>
. For examplenvm use lts
ornvm use 14.20.0
.
nvm off
— turns off version management for Node JSnvm on
— turns on version management for Node JSnvm uninstall <version>
— uninstalls a specific version of Node JSnvm arch
— shows whether NOde JS is running in a 32-bit or 64-bit mode