Introduction to Node Version Manager (NVM)
Node.js, a powerful runtime environment for JavaScript, offers a multitude of features and capabilities for building server-side applications. As Node.js evolves, different projects may require specific versions of Node.js to function correctly. Managing these versions can be challenging without the right tools. This is where Node Version Manager (NVM) comes in. In this article, we will explore how to install and use NVM to manage multiple Node.js versions effortlessly.

Understanding NVM
Node Version Manager (NVM) is a command-line tool that allows you to install and switch between multiple versions of Node.js on your machine. With NVM, you can easily install specific Node.js versions, switch between them for different projects, and seamlessly manage dependencies associated with each version.
Installing NVM on Unix-Based Systems (Mac and Linux)
To install NVM on Unix-based systems such as macOS and Linux, follow these steps:
- Open your terminal.
- Download the NVM installation script using cURL by running the command:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
. - Follow the prompts in the terminal to complete the installation. This will add the necessary NVM environment variables to your shell configuration file (e.g.,
.bashrc
,.zshrc
). - Close and reopen your terminal to ensure the NVM changes take effect.
- Verify the installation by running the command:
nvm --version
. It should display the installed version of NVM.

Installing NVM on Windows
Installing NVM on Windows requires a slightly different approach. Follow these steps:
- Visit the official NVM for Windows repository on GitHub (https://github.com/coreybutler/nvm-windows/releases).
- Download the latest stable release of NVM for Windows.
- Run the installer and follow the on-screen instructions. By default, NVM will be installed in the
%ProgramFiles%\nvm
directory. - After the installation is complete, open a new command prompt or PowerShell window.
- Verify the installation by running the command:
nvm version
. It should display the installed version of NVM.
Using NVM to Manage Node.js Versions
Now that NVM is installed, you can start managing your Node.js versions effortlessly. Here are a few common NVM commands:
nvm install version
: Installs the specified version of Node.js. For example,nvm install 14.17.3
installs Node.js version 14.17.3.nvm use version
: Switches the current shell session to use the specified version of Node.js. For example,nvm use 14.17.3
sets the Node.js version to 14.17.3 for the current session.nvm alias default version
: Sets the default Node.js version to use in new shell sessions. For example,nvm alias default 14.17.3
sets the default version to 14.17.3.nvm list
: Lists all installed Node.js versions and indicates the currently active version.
Installing Node.js with NVM
With NVM, installing Node.js versions is a breeze. Here’s how to install a specific Node.js version using NVM:
- Open your terminal or command prompt.
- Check the available Node.js versions by running the command:
nvm ls-remote
. - Choose the desired version and install it using the command:
nvm install version
.

My name is Mark Stein and I am an author of technical articles at EasyTechh. I do the parsing, writing and publishing of articles on various IT topics.
+ There are no comments
Add yours