Install Node on Windows and easily switch between Node versions with Node version manager for Windows

Node Oct 2, 2021

If you are working on multiple projects that have different Node versions, it can become quite cumbersome to keep installing and uninstalling different Node versions. There is an easy tool that will solve this issue, called Node version manager for Windows (NVM). You can use this tool to both install Node and also switch between Node versions.

1. Download the NVM installer

Let's start by downloading the installer, by going to this website nvm-windows, and clicking on the latest version, in my case, it is 1.1.18.

nvm_windows_github

After you clicked on the version, scroll down all the way and you will find the installer. Click on nvm-setup.zip and the download will start.

nvm_windows_github_download_link

2. Install NVM for Windows

After the download, we have to extract the nvm-setup.zip file, and open the extracted map, here you will find the nvm-setup.exe. Click on nvm-setup.exe and the installer will open up.

nvm_windows_setup
  1. In the installer select I accept the agreement and click Next.
nvm_windows_setup_wizard
  1. On the next screen you can select the path where you want to install Node version manager, I will stick with the default, click Next to continue.
nvm_windows_setup_wizard_path_selector
  1. On the next screen, you have to select the path where Node will be installed, again I will stick with the default, click Next to continue.
nvm_windows_setup_wizard_symlink_selector
  1. After that you can click on Install.
nvm_windows_setup_wizard_install
  1. After that the installation will be done, click on Finish to close the installer.
nvm_windows_setup_wizard_install_finished

3. Confirm the installation and install Node

To confirm that we have a working Node version manager let's open our terminal by pressing the Windows button and typing cmd and pressing enter.

In the console, we will type nvm to get the list of possible commands. We are interested in the install command and I will install the lts (long-term support) version and the latest version.

command_prompt_nvm_command

You can install node by using one of the following commands: npm install lts, npm install latest or npm install 14.17.0 (change it with your desired version) to install Node.

command_prompt_nvm_install_lts_command
command_prompt_nvm_install_latest_command
command_prompt_nvm_install_certain_version_command

I have installed 2 versions so that I can demonstrate to you how to switch between versions, first I will use nvm list to get all installed versions. After that switching is as easy as typing nvm use 14.18.0 and we will be switched.

command_prompt_nvm_list_command
Tip: You can uninstall a Node version with the following command: nvm uninstall 14.17.0.

4. Conclusion

With NVM for Windows, you can easily install and uninstall Node and switch between Node versions. So far I think this is the most convenient way of switching between versions. If you enjoy using this tool make sure to give Corey Butler some love by starring his package nvm-windows.

Tags