Node Version Manager is the most convenient way to manage different Node.js versions. We, as developers, oftentimes need to change between different Node.js versions depending on the project. Without Node Version Manager, changing Node.js versions can be cumbersome. In this article, you will learn how to: install NVM on Ubuntu, install NVM on macOS, install NVM on WSL2 and install NVM on Windows.
Table of Contents
- Important NVM Commands
- Install NVM Windows
- Install NVM Ubuntu
- Install NVM WSL2
- Install NVM macOS
- Summary
Important NVM Commands
The NVM commands are the same on every operating system except for Windows. Therefore, we are going to look at the most important NVM commands first to familiarize you with NVM.
The specific NVM Windows commands are listed in the Windows section.
Install Latest Node.js Version Using NVM
To install the latest version of Node.js, run:
Code language: plaintext (plaintext)nvm install node
Install Node.js LTS Using NVM
To install the LTS version of Node.js, run:
Code language: plaintext (plaintext)nvm install --lts
List Available Node.js Versions
To list all available Node.js versions that are supported in NVM, run:
Code language: plaintext (plaintext)nvm ls-remote
Install Specific Node.js Version Using NVM
To install any other version of Node.js, run:
Code language: plaintext (plaintext)nvm install {version}
Listing Installed Node.js Versions
To list all installed NVM versions, type:
Code language: plaintext (plaintext)nvm list
Switching Node.js Versions Using NVM
To switch/enable a version of Node.js, run:
Code language: plaintext (plaintext)nvm use {version}
Install NVM Windows
NVM does not directly support Windows. Therefore we need to use the nvm-windows package instead (officially listed in the NVM documentation). The nvm-windows package has more than 24.500 GitHub stars and is recommended by both Microsoft and Google.
To install NVM on Windows, download the nvm-setup.exe
installer here. After downloading, run the installer and leave everything as default.

Using NVM on Windows
To use NVM on Windows, we need to use PowerShell.
- Press the Windows Key and search for PowerShell.
- Launch PowerShell.
- Run the
nvm
command to verify that NVM is installed.

Install Latest Node.js Version on Windows
To install the latest Node.js version on Windows, run:
Code language: plaintext (plaintext)nvm install latest
Followed by the command below. Make sure to use your version number:
Code language: plaintext (plaintext)nvm use 19.2.0

Install Node.js LTS on Windows
To install the LTS version of Node.js on Windows, run:
Code language: plaintext (plaintext)nvm install lts
Followed by the command below. Make sure to use your version number:
Code language: plaintext (plaintext)nvm use 18.12.1

Install Specific Node.js Version on Windows
To install any other version of Node.js on Windows, run:
Code language: plaintext (plaintext)nvm install {version}
To use that particular version:
Code language: plaintext (plaintext)nvm use {version}
Install NVM Ubuntu
Installing NVM on Ubuntu is quick & easy. We can use either curl
or wget
to install NVM on Ubuntu. Make sure to install the latest version by checking it in the official GitHub repository.
Curl
Code language: plaintext (plaintext)curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
Wget
Code language: plaintext (plaintext)wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
Running either of these commands will automatically update the respective ~/.bash_profile
, ~/.zshrc
, ~/.profile
, or ~/.bashrc
files.
Make sure to restart your terminal after the installation has finished or run the source ~/.{yourProfile}
command to update your config.
Verify Installation
To verify if everything was installed correctly, run:
Code language: plaintext (plaintext)nvm

Install Latest Node.js Version on Ubuntu
To install the latest Node.js version on Ubuntu, run:
Code language: plaintext (plaintext)nvm install node nvm use {version}

Install Node.js LTS on Ubuntu
To install the LTS version of Node.js on Ubuntu, run:
Code language: plaintext (plaintext)nvm install --lts nvm use {version}

Additional Commands
For more commands, check the important NVM commands section at the beginning of this article!
Install NVM WSL2
The steps to install NVM on WSL2 are the same as the steps for installing NVM on Ubuntu. Nevertheless, let’s quickly run through them. We can use either curl
or wget
to install NVM on WSL2. Make sure to install the latest version by checking it in the official GitHub repository.
Curl
Code language: plaintext (plaintext)curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
Wget
Code language: plaintext (plaintext)wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
Running either of these commands will automatically update the respective ~/.bash_profile
, ~/.zshrc
, ~/.profile
, or ~/.bashrc
files.
Make sure to restart your WSL2 terminal after the installation has finished or run the source ~/.{yourProfile}
command to update your config manually.
Verify Installation
To verify if everything was installed correctly, run:
Code language: plaintext (plaintext)nvm

Install Latest Node.js Version on WSL2
To install the latest Node.js version on WSL2, run:
Code language: plaintext (plaintext)nvm install node nvm use {version}

Install Node.js LTS on WSL2
To install the LTS version of Node.js on WSL2, run:
Code language: plaintext (plaintext)nvm install --lts nvm use {version}

Additional Commands
For more commands, check the important NVM commands section at the beginning of this article!
Install NVM macOS
There are two ways how to install NVM on macOS. You can either use Homebrew, or you install it by using either curl
or wget
.
Install NVM macOS Using Homebrew
If you do not have Homebrew installed, you can install it by using the following command:
Code language: plaintext (plaintext)/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
To install NVM on macOS with Homebrew, run:
Code language: plaintext (plaintext)brew install nvm
This will install the latest and most up-to-date version of NVM on your mac.
Install NVM macOS Using Curl or Wget
The classic way of installing NVM on macOS is by using the curl
or the wget
command.
Curl
Code language: plaintext (plaintext)curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
Wget
Code language: plaintext (plaintext)wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
Running either of these commands will automatically update the respective ~/.bash_profile
, ~/.zshrc
, ~/.profile
, or ~/.bashrc
files.
Make sure to restart your macOS terminal after the installation has finished or run the source ~/.{yourProfile}
command to update your config manually.
Verify Installation
To make sure that NVM has been correctly installed on macOS, run:
Code language: plaintext (plaintext)nvm --version

Install Latest Node.js Version on macOS
To install the latest Node.js version on macOS, run:
Code language: plaintext (plaintext)nvm install node

Install Node.js LTS on macOS
To install the LTS version of Node.js on macOS, run:
Code language: plaintext (plaintext)nvm install --lts nvm use {version}

Additional Commands
For more commands, check the important NVM commands section at the beginning of this article!
Summary
NVM is an excellent tool for managing Node.js versions in your various Web Development projects. If you want to get started with Web Development, make sure to check out our Web Development section.
This should get you up and running no matter on which OS you are. Should you have any kind of problems during the installation, make sure to check the troubleshooting section in the official GitHub repository of NVM.