Effortlessly Manage Multiple Node.js Versions on Windows with nvm-windows
As a developer, managing multiple versions of Node.js can be challenging, especially when different projects require different versions. Thankfully, nvm-windows
(Node Version Manager for Windows) simplifies this process, allowing you to switch between Node.js versions effortlessly without the need for tedious installations or uninstallations.
What is nvm-windows?
nvm-windows
is a command-line utility that lets you manage multiple installations of Node.js on a Windows machine. It enables you to switch between different Node.js versions easily, ensuring that your projects run on the appropriate version without any conflicts.
Installing nvm-windows
Follow these steps to install nvm-windows
on your system:
Download the installer: Visit the nvm-windows releases page and download the latest
nvm-setup.zip
file.Run the installer: Extract the downloaded zip file and run
nvm-setup.exe
. Follow the on-screen instructions to complete the installation.Verify the installation: Open a new Command Prompt window and type:
nvm -v
Using nvm-windows
With nvm-windows
installed, you can start managing your Node.js versions effortlessly.
Installing a Node.js Version
To install a specific version of Node.js, use the following command:
nvm install <version>
//for example
//nvm install 14.17.0
Listing Installed Versions
To see a list of all installed Node.js versions, use:
Switching Between Versions
Switching between different Node.js versions is simple:
nvm use <version>
//for example
//nvm use 14.17.0
Setting a Default Version
To set a default Node.js version that nvm-windows
will use whenever a new terminal window is opened, use:
nvm use <version> --default
//for example
//nvm use 14.17.0 --default
Uninstalling a Node.js Version
If you no longer need a particular version of Node.js, you can uninstall it with:
nvm uninstall <version>
//for example
//nvm uninstall 14.17.0
Tips for Effective Use
Keep it updated: Regularly update
nvm-windows
and your Node.js versions to benefit from the latest features and security patches.Project-specific versions: Utilize
.nvmrc
files in your projects to specify which Node.js version should be used.nvm use
will read this file and switch to the specified version automatically.
By following these steps, you can efficiently manage multiple Node.js versions on your Windows machine, ensuring smooth development across different projects.
Subscribe to my newsletter
Read articles from Prateek Kumar directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Prateek Kumar
Prateek Kumar
Software Developer