NVM for Windows v1.1.8 Notes
Truth be told, I did not want to release this version right now. I am working on the successor project rt, which was supposed to be the last version before the rt release. However, notable changes in the Node ecosystem warrant a new version now.
Node Corepack
In September 2021, Node.js v16.9.0 introduced corepack. This experimental new feature allows transparent use of npm, pnpm, or yarn. To support this feature, NVM4W must download and process a different distribution file than it has used previously.
As a result, NVM for Windows 1.1.8 is being released to support corepack.
How to Upgrade
All files can be found on the release page.
If you do not have NVM for Windows installed
Use the instructions in the README.
If you already have an older version of NVM for Windows installed
Download nvm-update.zip and extract it. You will find a file called nvm-update.exe. Double click to run it. This will prompt for the version you wish to upgrade to (pre-populated w/ 1.1.8).
nvm-update.exe can also be run from the command line using the /S
flag to suppress the prompt. To do this, run nvm-update.exe 1.1.8 /S
.
What’s New
Several long-requested features/fixes have been merged since v1.1.7. I did not get to test all of them as extensively as I wanted to, but I believe they are stable. These features include:
- corepack support (see above)
- Support for spaces in filepaths #355 (@s-h-a-d-o-w).
nvm install latest
— installs the latest patch version of Node (instead of latest minor).nvm install lts
— installs the latest LTS patch version (new). (@tats-u)nvm use latest
,nvm use lts
(@tats-u), andnvm use newest
(new) (@EEJesse) now supported.- Elevated permissions applied only when necessary #511 (@rbuckton).
nvm current
(new) displays the active version. (@riazXrazor)
Numerous edge case fixes have been applied as well.
- Read environment variables in settings.txt (@mscott3)
- Compilation fixes (@taaem)
- Fix major version check (@rcknight)
- Parameterized settings.txt loader (@himself65)
A number of documentation updates have also been merged.
What didn’t make it in?
- Aliases — these were originally scheduled for 1.1.8, but I never got to work on them.
WARNING
Version 1.1.8 is not code signed. Code-signed applications are trusted by Windows and will install easily. Users are prompted with a screen like this one:
Non-code-signed applications can usually be installed, but they will throw a warning like this:
Why?
I paid for the last code signing certificates out of pocket, but they’ve expired. Sponsorships, to date, haven’t even come close to covering the cost of a new code signing certificate (let alone the last one).
Who will this affect?
This won’t affect most users, but enterprise users and those distributing NVM4W in corporate environments may run into problems.
If your organization is impacted by this, I will accept sponsorship money to expedite the delivery of a code-signed version. The required EV certificate is about $1000. Please direct message me on Twitter @goldglovecb if you’d like to help cover this cost.
Different software development tools might require specific versions of Node.js and NPM (Node Package Manager). NPM is a tool for managing packages installed from the NPM registry.
In addition, if you are making an NPM package, you might need to test it with different versions of Node.js. This is why you should have NVM installed.
NVM, short for Node Version Manager, is a command line tool for managing and switching to different versions of Node.js.
In this article, I will show you how to download and install NVM on Windows 10 – even though there’s no “NVM” for Windows.
I will also show you how to set up and use different versions of Node.js and NPM on your Windows computer.
What We’ll Cover
- How to Download and Install Node Version Manager in Windows 10
- Follow the steps below to download nvm-windows
- How to Use NVM on Windows 10
- How to Install Different Versions of Node.js and NPM with NVM
- Recap
As I mentioned earlier, there’s no “NVM” for Windows, as NVM is only supported on Linux and Mac.
What you will be using on your Windows machine is “nvm-windows”. nvm-windows is similar to NVM, but not identical to it.
N.B.: If you have Node.js installed already, you need to uninstall it so it doesn’t lead to errors when using different versions of Node and installing packages from the NPM registry.
Restart your PC after that, open the command prompt or PowerShell, and run node -v
to confirm Node has been uninstalled.
In addition, if you have yarn installed, uninstall it and reinstall it after installing NVM. You don’t want to get weird errors while installing and using packages from the NPM registry.
Follow the steps below to download nvm-windows
- Step 1: Head over to the nvm-windows repository and click on Download Now!”
You’ll be taken to a page containing different versions of nvm-windows.
-
Step 2: Click on the latest version to download it. For now, it is the April 28, 2022 version.
-
Step 3: Locate the installer on your computer and open it. Follow the installation wizard to install it.
-
Step 4: Open up PowerShell or Command Prompt and run
nvm -v
to confirm the installation.
If you get the same message I got above, then nvm-windows has been successfully installed. Congrats!
How to Use NVM on Windows 10
To use NVM, you need to open PowerShell or Command Prompt as an admin. You can also use Git bash.
-
To open PowerShell as admin, right-click on Start and select “PowerShell (Admin)”.
-
To open Command Prompt as admin, search for “cmd” and select “Open as Administrator” on the right.
How to Install Different Versions of Node.js and NPM with NVM
The superpower NVM gives you is the ability to have multiple versions of Node.js installed on your machine.
To install the latest version of Node, run nvm install latest
.
It is always better to install the long-term support (LTS) version of Node because it is less buggy.
To install the LTS version of Node, run nvm install lts
.
To install a specific version of Node, you need to run nvm list available
first so you can see the versions of Node that are available.
To install that specific version, run nvm install node-version-number
. For example, nvm install 14.20.0
.
N.B.: Once you install a version of Node, the corresponding version of NPM is installed for you. So you don’t need to install NPM separately.
If the version of NPM you want to use is not available, run npm install @npm version-number -g
to install it.
Now, to see the list of Node versions you have installed on your Windows machine, run nvm list
.
To use a specific version of Node, run:
nvm use latest
to use the latest versionnvm use lts
to use the long-term support versionnvm use version-number
to use any other version you have installed
Recap
This article showed you how to install NVM on Windows 10 (nvm-windows) and how to use it to install and manage different versions of Node.
As a reminder, here are the common commands you’ll be using with nvm-windows:
nvm install node-version
– install a version of Nodenvm list
– see the versions of Node you have installed on your machinenvm use node-version
– use a specific version of Node
Thank you for reading and keep coding
Learn to code for free. freeCodeCamp’s open source curriculum has helped more than 40,000 people get jobs as developers. Get started
NVM is a Node Version Manager used to manage multiple Node.js versions on systems.
Why NVM Need?
NVM makes it easy to install and manage different Node versions on your machine or laptop, and you can switch between them whenever you need it from one node version to another based on your need. To switch to another version of node.js, you have to run a few commands, which I will explain in the below sections.
Suppose you have installed the specific version of node 18.0.0 on your machine, and you will get another project that project needs a higher or lower version of node.js (either node version 20.0.0 or 16.0.0 )to run the project on your machine but your system has node 18.0.0. So when you try to install packages and run the project you will get the Node version.
In the following sections, I’ll guide you through installing NVM on your Windows, Linux, or Mac device.
Before proceeding, I recommend uninstalling Node.js if you installed it to avoid conflicts between Node.js and NVM.
Installing NVM on Windows
NVM is primarily supported on Linux and Mac, but not on Windows. However, there’s a similar tool called nvm-windows created by Corey Butler, which provides a similar experience for managing Node.js versions on Windows.
Below are the steps on how to install nvm-windows:
1. Download nvm-windows:
Go to the nvm-windows repository README file and click on the Download Now button, Or you can click here to Download. This will take you to a page with various NVM releases.
Download the NVM for Windows
-
Install the .exe file:
Once you are redirected to the release page (currently version 1.1.12) click on nvm-setup.exe and it downloads the nvm-windows on your machine.
-
Run the installer:
Open the downloaded file and follow the prompts to complete the installation wizard. -
Verify the installation:
After installation, open a command prompt and run:
nvm -v
Enter fullscreen mode
Exit fullscreen mode
If everything is installed correctly, this command will display the installed NVM version.
NVM Commands for switching between Node versions:
To view available Node versions, run the following command:
nvm list
Enter fullscreen mode
Exit fullscreen mode
Now you can see what the list of node versions available in the machine looks like,
If you want to select a specific version of the node.js that version is in the above list (screenshot image). Then run the below commands to select the particular node version and press enter.
Here I am selecting node version 14.17.1
nvm use v14.17.1
Enter fullscreen mode
Exit fullscreen mode
Verified selected node version:
node -v
Enter fullscreen mode
Exit fullscreen mode
then you will see the selected node version instead of the default one, here I have selected node 14 so it will show nod 14 for me.
What happens if the specified version of the node is not available then we have to install it using nvm command and then select it from the above steps.
To install a specific node version:
nvm install 20.0.0
Enter fullscreen mode
Exit fullscreen mode
Thank you for reading our article, I have tried to cover the all-important command and steps for more details visit the nvm-windows
Please like follow and share, I need your support!!
Thank you!!
Follow Me on:
Linkedin
Medium
X(formally known as Twitter)
Post Views: 6,960
NVM also knows as a “Node Version Manager” used for installing multiple version of Node.js in your system. NVM allows you to easily switch between different Node.js versions. In my previous article, you learned how to install Node.js and NPM on Windows 10.
Now, I will explain how to install and use NVM for Windows on Windows 10.
Prerequisites
- A system running Windows 10 or Windows server with Node.js installed.
- An administrator password is configured on your server.
In order to download NVM for Windows installer, go to the NVM GitHub page as shown below:
Now, click on the nvm-setup.zip to download the setup file in your Windows system. Once the download is completed, follow the below steps to install NVM for Windows:
Step 1 – Extract the downloaded zip file and double-click on the installer to start the installation. You should see the following screen:
Step 2 – Accept the License agreement and click on the Next button. You will be asked to provide Node.js installation path as shown below:
Step 3 – Specify the installation path and click on the Next button. You should see the following screen:
Step 4 – Now, click on the Install button to start the installation. Once the installation is completed, you should see the following screen:
Step 5 – Now, click on the Finish button to finish the installation. Now, restart your system to apply the system-wise path.
Verify the NVM Version
At this point, NVM is installed in your system. Now, search for Windows command prompt (cmd) => Right-click and click on run as an administrator user. This will open the Windows command prompt. Now, run the following command to verify the NVM version:
nvm --version
You should see the installed version NVM in the following screen:
Next, you will need to enable the NVM to manage the Node.js. You can enable it with the following command:
nvm on
Manage Node.js with NVM
You can list all available version of Node.js with the following command:
nvm list available
You should see all Node.js versions in the following screen:
To install the latest version of Node.js, run the following command:
nvm install latest
To install the specific version of Node.js, run the following command:
nvm install 14.15.4
If you want to switch to the specific Node.js version, run the following command:
nvm use 14.15.4
You can now verify your current Node.js version with the following command:
node --version
Conclusion
In the above guide, you learned how to install NVM for Windows and manage Node.js version with NVM. I hope this will helps you to manage the different Node.js versions.
Are you having trouble switching between different versions of Node.js as your build your project? Let Node Version Manager (NVM) save the day. Install NVM on Windows and save yourself the trouble of managing multiple Node.js versions.
Installing and using NVM can be a bit tricky, especially on Windows. But in this tutorial, you will learn how to install and use NVM on Windows to install different versions of Node.js.
Read on, and switch between Node.js versions without the hassle!
Prerequisite
This tutorial will be a hands-on demonstration. To follow along, be sure you have the following:
- A Windows 10 computer with administrative privileges.
- A code editor – This tutorial uses Visual Studio Code (VS Code), but you can use any code editor you are comfortable with.
How to Download and Install NVM on Windows
Switching between Node.js versions should not be complicated, and NVM is up to the task. But before you can use NVM, you must download and install it on your machine.
To download and install NVM:
1. Open your favorite web browser, navigate to the official download page on GitHub, and find the latest version of the installer. At this time of writing, the latest version is 1.1.9.
2. Scroll down to the Assets section of the GitHub page, and click nvm-setup.exe to download the NVM installer for Windows.
3. Once downloaded, double-click the installer to run it.
4. Now, choose the I accept in the Agreement option and click Next to accept the license agreement.
5. Select a location for NVM to be installed, and click Next.
Note the location, as you will need it later if NVM does not work correctly.
6. On the next screen, keep the settings as is and click Next. This setting lets you set the symlink directory, which is used to access NVM from the command line.
7. Next, click Install to begin installing NVM.
The installation process starts, and a status bar indicates progress.
8. Once installed, click Finish to close the installer.
At this point, NVM is now installed on your Windows machine.
9. Lastly, open PowerShell as administrator and run the below command to check NVM’s version installed.
If NVM is installed correctly, you will see the version number of NVM printed on the screen, as shown.
Configuring the PATH Environment Variable for NVM
The nvm
command should successfully return NVM’s installed version. But what if you got an error instead, like the one below?
This error indicates the PATH environment variable is not configured correctly. The PATH environment variable is what tells your computer where to look for executable files like nvm.exe.
To fix this error, add the location of the NVM executable file to your PATH environment variable:
1. Run the below command to set the PATH environment variable for NVM.
Replace INSTALL_PATH
with the NVM executable file’s path you noted in step five of the “Downloading and Installing NVM for Windows” section.
Setx path "%PATH%;INSTALL_PATH”
The output below shows setting the PATH environment variable for NVM is a success.
A restart might be required for the new PATH variable to take effect.
2. Now, run the below command to recheck the version number of NVM.
As you can see below, the nvm
command now works in checking your NVM version.
Using NVM to Install Multiple Versions of NodeJS
Now that you have NVM installed and configured, you can use it to install multiple versions of Node.js side-by-side on your machine.
This feature is useful when working with projects requiring different versions of Node.js. For example, you can test a module you are developing without uninstalling the stable version of Node.js.
Installing the Latest Version of Node.js
When installing tools or any packages, typically, you would choose to get the latest version.
Run the below command to download and install
the latest
version of Node.js.
You will see a similar output as below, which shows the latest version of Node.js (19.0.0) installed on your machine.
Installing the Latest LTS Version of Node.js
The latest version of Node.js is not always the best choice for production environments. Why? The latest version might introduce breaking changes or might be unstable.
What are your other choices for installing Node.js? The Long Term Support (LTS) version of Node.js is most recommended for production environments. The LTS version is more stable and well-tested than the latest version.
Run the below command to install
the LTS (lts
) version of Node.js
Below, you can see the latest LTS version of Node.js installed, which is 18.12.0 at this time of writing.
Installing a Specific Version of Node.js
What if you need to install a specific version of Node.js? Worry not. NVM lets you choose which version of Node.js to install without overwriting over ones currently installed on your machine.
Installing a specific version of Node.js is often required when working on an older project that is incompatible with the newer version of Node.js.
Run the following command to list
all versions of Node.js that are available
for installation via NVM.
You will see a list of all the versions of Node.js that are available for installation below. Pick one version you wish to install.
Now, run the below command to install
Node.js v16.18.0
on your machine. But you can replace v16.18.0
with your preferred version.
Switching Between Multiple Versions of Node.js
Perhaps you are working on a project that requires Node.js v16.x and another project that requires Node.js v18.x. If so, how do you switch between Node.js versions?
Luckily, you can use NVM to switch between these two versions as needed quickly.
1. Run the below command to see which version of Node.js is currently (current
) in use.
Below, the output shows the current Node.js version in use is v16.18.0. Now all you need is the version you want to switch to. But first, you must check if that version is also installed on your machine.
2. Next, run the following command to list
all Node.js versions that are currently installed on your machine. nvm list
You will get an output like the one below, which shows all versions of Node.js installed.
3. Finally, run the nvm use
command below to switch to Node.js version 18.12.0
. Replace 18.12.0
with the actual Node.js version number to switch to.
Running a Simple Hello World Program
Now that you have Node.js installed on your machine, you can try running a simple Hello World program to verify that everything is working as expected.
Create a new JavaScript file named hello-world.js
Open hello-app.js in your preferred text editor, add the following code to the file and save and close the editor.
The code below prints the string Hello World
to the console.
var msg = 'Hello World';
console.log(msg);
Now, run the node command below to execute the *hello-app.js*
script.
If all goes well, you will see the Hello World message printed on the console, as shown below. This output confirms that Node.js has been successfully installed on your machine.
Conclusion
Running and managing multiple versions of Node.js on the same machine can be a pain. But in this tutorial, you learned how to use NVM to install and manage different versions of Node.js on your machine.
Now that you have discovered how quickly you can switch between different versions of Node.js, would you consider NVM to level up your workflow?