The Simplified Guide to Using NVM on Windows for Node.js Version Management

M. Ilham Margatama
3 min readFeb 7, 2023
Photo by Juanjo Jaramillo on Unsplash

Well, I’ll share my experience using NVM when handling multiple projects with different Node.js versions.

Let’s talk about the definition, Node Version Manager or NVM is a tool for managing the Node version on your device. The question is why do you need to manage your Node version? Well, you will need it when you work on multiple projects and the project uses different versions of Node.

For example, when you working on project A, it uses version 14.0.0. Then you need to fix a bug in project B that uses version 16.0.0 immediately. It will be straightforward to use nvm. So, let’s go to the tutorial.

How to Install NVM

Download the setup

Open the nvm-repository, then click “Download Now!”. Once the installer is downloaded, run it and follow the prompts to install NVM.

Verify NVM Installation

To verify that NVM is installed correctly, open a command prompt or terminal window and type nvm version. If the installation was successful, it should return the nvm version.

Install a Node.js Version

With NVM installed, you can install different versions of Node.js. To install a specific version of Node.js, use this command:

nvm install <version number>

For example, to install version 18.14.0, use this command:

nvm install 18.14.0

To list all available versions of Node.js use this command:

nvm list available

To list installed versions in your machine use this command:

nvm list

Switch to a Different Version of Node.js

Once you installed multiple versions of Node.js, you can switch between them easily using NVM. To switch to a different version, use this command:

nvm use <version number>

For example, to switch to version 18.13.0, use this command:

nvm use 18.13.0

*Note: you must run the terminal with administrator privilege to switch between node versions.

Conclusion

With NVM, you can easily manage multiple versions of Node.js on your Windows machine. Whether you need to switch between versions for different projects or just want to try out the latest version, NVM makes it easy to install and manage your Node.js installations. Give it a try and see how it can simplify your Node.js development process.

--

--