Learn how to easily install nvm on your Windows computer with this helpful guide. Get up and running with the latest version of Node.js in no time!
Node Version Manager (NVM) is a powerful tool that allows you to easily switch between various versions of Node.js, the popular JavaScript runtime environment. It is especially useful for developers who need to test their code across multiple versions of Node.js. In this article, we’ll look at how to install NVM on Windows.
Step 1: Download and Install Chocolatey
The first step in installing NVM on Windows is to download and install Chocolatey, a package manager for Windows. Chocolatey makes it easy to install and manage software on Windows. To install Chocolatey, open a Windows command prompt as an Administrator and run the following command:
```
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
```
Once Chocolatey is installed, you can use it to easily install NVM and other packages.
Step 2: Install NVM
Now that Chocolatey is installed, you can use it to install NVM. To install NVM, run the following command in the same command prompt window:
```
choco install nvm
```
Chocolatey will download and install NVM. Once it is finished, you can verify that NVM is installed by running the following command:
```
nvm --version
```
Step 3: Install Node.js Versions
Now that NVM is installed, you can use it to install multiple versions of Node.js. To install a version of Node.js, you can run the following command:
```
nvm install
```
For example, to install the latest version of Node.js, you can run the following command:
```
nvm install latest
```
You can also specify a specific version of Node.js. For example, to install version 10.16.3 of Node.js, you can run the following command:
```
nvm install 10.16.3
```
Once the installation is complete, you can verify that it was successful by running the following command:
```
nvm list
```
This will list all of the installed versions of Node.js.
Step 4: Set the Default Version
Once you have installed multiple versions of Node.js, you can set a default version to be used when you open a new command prompt window. To set the default version, run the following command:
```
nvm use
```
For example, to use version 10.16.3 of Node.js as the default, you can run the following command:
```
nvm use 10.16.3
```
Step 5: Uninstall a Version of Node.js
If you need to uninstall a version of Node.js, you can use NVM to do so. To uninstall a version, run the following command:
```
nvm uninstall
```
For example, to uninstall version 10.16.3 of Node.js, you can run the following command:
```
nvm uninstall 10.16.3
```
Conclusion
In this article, we’ve looked at how to install NVM on Windows. We’ve seen how to download and install Chocolatey, use it to install NVM, install multiple versions of Node.js, set the default version, and uninstall a version. NVM is an invaluable tool for developers who need to test their code across multiple versions of Node.js.
Terms of Service Privacy policy Email hints Contact us
Made with favorite in Cyprus