HOW TO INSTALL NVM ON WINDOWS
Tags: webdev, nvm, node, npm
Published: 2024-03-05 10:43:19

If you find yourself at a crossroads, wondering how to seamlessly manage different Node.js versions, worry not - I'm here to guide you through the installation process of NVM (Node Version Manager). NVM is a tool that allows you to easily manage multiple installations of node.js on a single machine. It is useful for developers who work on projects with different node versions required.

> _NVM is different from NPM in that NPM is for managing different packages or libraries of different JavaScript code written by other developers._

---


## **INSTALLING NVM FOR WINDOWS**

> _Before diving into NVM, ensure you uninstall any existing Node.js versions to prevent conflicts with the upcoming NVM installation._

1. Clear your terminal to create a clean slate. This ensures a smooth space for NVM installation.

2. Navigate to the [NVM for Windows repository on github](https://medium.com/r/?url=https%3A%2F%2Fgithub.com%2Fcoreybutler%2Fnvm-windows%2Freleases) to download the nvm installer. In the **assets folder** click the file that reads **'nvm-setup.exe'**


![a picture showing the nvm github repo showing the assets folder](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/njza1dco15xrq7m52nqn.PNG)

 This initiates the download of the latest version of nvm to your machine.

- 3. Once installed, open a new terminal and confirm the successful installation by typing in the command:

```
nvm -v
```

This command should display the version number of the latest NVM you installed.

## **USING NVM TO SWITCH BETWEEN NODE VERSIONS**

Now that NVM is at your disposal, let's explore its power to effortlessly manage various Node.js versions for diverse projects.

---

1. Upon NVM installation, you can:

a. Run your project on the new terminal to confirm the required node version (an error indicating the required Node.js version will definitely be displayed) OR

b. In the package.json file, under dependencies, look for **'@types/node'**. This usually indicates the node version required for the project.


![Screenshot of package.json file](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bsuhcsgi7kyppx8yuvzb.PNG)

Now that you know the version required, you can install it by running the command:

```
nvm install <specified_version>
```

For instance, if the project needs version 16.14.0:
```
nvm install 16.14.0
```

---


- 2. Receive confirmation with the "Installation complete" message. To switch to the installed version, type in the command:

```
nvm use 16.14.0
```

---


- 3. Effortlessly manage your Node.js versions by checking the installed ones with this command:

```
nvm list
```

---

## **Conclusion**

Embrace the convenience of NVM - install different versions as per project requirements, seamlessly switch between them, and bid farewell to storage congestion and the tedious cycle of downloading and uninstalling. NVM is your gateway to efficient Node.js version management.

For further contributions or any questions, feel free to connect with me on [Twitter](https://medium.com/r/?url=https%3A%2F%2Fx.com%2Ffisayodoris%3Fs%3D21%26t%3Dls7kw_ktdpGNCqkEeO_26w). Until next time, happy coding!