In this article, I'll explain how you can install NVM, or Node Version Manager, on Windows, Linux, and Mac.
Nvm Download: https://www.nvmnode.com/guide/download.html
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.
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.
All nvm Command Lines
- nvm arch: Shows if node is running in 32-bit or 64-bit mode.
- nvm install [arch]: Install node, where version is a specific version or the latest stable version (latest). Optional parameter arch specifies 32-bit or 64-bit installation, default is system architecture. You can add --insecure to bypass SSL on remote servers.
- nvm list [available]: Shows installed node versions. Optional parameter available shows all versions available for installation. list can be shortened to ls.
- nvm ls or nvm list: Shows installed node versions.
- nvm on: Enables node.js version management.
- nvm off: Disables node.js version management.
- nvm proxy [url]: Sets download proxy. Without the optional url parameter, it shows the current proxy. Setting url to none removes the proxy.
- nvm node_mirror [url]: Sets node mirror. Default is https://nodejs.org/dist/. If url is not specified, the default url is used. After setting, you can check in the settings.txt file in the installation directory, or modify it directly in that file.
- nvm npm_mirror [url]: Sets npm mirror. Default is https://github.com/npm/cli/archive/. If url is not specified, the default url is used. After setting, you can check in the settings.txt file in the installation directory, or modify it directly in that file.
- nvm uninstall : Uninstalls the specified node version.
- nvm use [version] [arch]: Uses the specified node version. Can specify 32/64-bit architecture.
- nvm root [path]: Sets the directory where different node versions are stored. If not set, the current directory is used by default.
- nvm version or nvm v or nvm -v: Shows nvm version. version can be shortened to v.
How to Install NVM on Linux and Mac
Since Linux and Mac have some similarities (they are both UNIX-based OSes), you can install nvm on them in similar ways.
1. Run the nvm installer
In your terminal, run the nvm installer like this:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
# or
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
You can use curl or bash depending on the command available on your device.
These commands will clone the nvm repository to a ~/.nvm directory on your device.


Top comments (0)