Easy Steps to Install NVM for Managing Node Versions

only softwareonly software
3 min read

What is NVM?

Node Version Manager (NVM), as the name implies, is a tool for managing Node versions on your device.

Different projects on your device may be using different versions of Node. Using only one version (the one installed by npm) for these different projects may not give you accurate execution results.

For example, if you use a Node version of 10.0.0 for a project that uses 12.0.0, you may get some errors. And if you update the Node version to 12.0.0 with npm, and you use it for a project that uses 10.0.0, you may not get the expected experience.

In fact, you would most likely get a warning that says:

This project requires Node version X

Instead of using npm to install and uninstall Node versions for your different projects, you can use nvm, which helps you effectively manage your node versions for each project.

NVM allows you to install different versions of Node, and switch between these versions depending on the project that you're working on via the command line.

In the next sections, I'll show you how to install NVM on your Windows, Linux, or Mac device.

Before proceeding, I also recommend that you uninstall Node.js if you have it installed already so that you do not have any conflicts with Node.js and nvm.

How to Install NVM on Windows

NVM is mostly supported on Linux and Mac. It doesn't have support for Windows. But there's a similar tool created by coreybutler to provide an nvm experience in Windows called nvm-windows.

nvm-windows provides a management utility for managing Node.js versions in Windows. Here's how to install it:

1. Click on "Download Now"

In the nvm-windows repository Readme, click on "Download Now!":

This will open a page showing different NVM releases.

2. Install the .exe file of the latest release

In the latest release (which as of the time of writing this is v1.2.2), you'll find different assets. Click on the nvm-setup.exe asset which is the installation file for the tool:

3. Complete the Installation Wizard

Open the file that you have downloaded, and complete the installation wizard.

When done, you can confirm that nvm has been installed by running:

nvm -v

If nvm was installed correctly, this command will show you the nvm version installed.

This has always been a node version manager, not an io.js manager, so there is no back-support for io.js. Node 4+ is supported. Remember when running nvm install or nvm use, Windows usually requires administrative rights (to create symlinks). To install the latest version of Node.js, run nvm install latest. To install the latest stable version, run nvm install lts.

The Easiest Way to Install and Switch Between Node.js Versions

There are situations where the ability to switch between different versions of Node.js can be very useful. For example, if you want to test a module you're developing with the latest bleeding edge version without uninstalling the stable version of node, this utility can help.

nvm use newset

this command is use for install latest version of node version

⭐ ⭐ Uninstall any pre-existing Node installations!! ⭐ ⭐

Note: If you run into issues while installing NVM, it might be because you already have Node.js installed from the official Node.js website. In that case, uninstall the existing Node.js first, then install NVM. I faced the same issue, and this fix worked perfectly.

If you found this helpful, consider sharing it with a fellow developer or leaving a comment below with your experience!

Happy coding! 👨‍💻👩‍💻

0
Subscribe to my newsletter

Read articles from only software directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

only software
only software