DEV Community

Cover image for Simplest way to Downgrade Node Version on Windows
raielly
raielly

Posted on

Simplest way to Downgrade Node Version on Windows

In this article, we'll walk through the simple steps to downgrade Nodejs version on Windows. So, let's get started!

To begin, we need to install the Node Version Manager (NVM) which will handle the node version management. We can do this by going to the link provided and downloading the NVM setup execution file.

https://github.com/coreybutler/nvm-windows/releases

NVM

Next, we will need to run the NVM installer. Once we have downloaded the installer from the link provided, we can find it in "Downloads" folder (usually the default location). Simply navigate to the folder and double-click on the "nvm-setup.exe" file to initiate the installation process.

After double-clicking on the "nvm-setup.exe" file, a wizard called "Setup-NVM for Windows" will appear on screen. To proceed with the installation of NVM, we will need to accept the license agreement by selecting the corresponding radio button and clicking the "Next" button.

Setup-NVM for Windows

We can leave the default selected location as is and click the "Next" button. Finally, click the "Install" button to start the NVM installation process.

Install

Great job! We have successfully installed NVM on our Windows machine. All that's left to do now is to click the "Finish" button to wrap up the installation process and close the setup wizard.

NVM

And now, lets downgrade the Node version on Windows using NVM,

Open the Command Prompt on your Windows machine as an administrator. We can do this by searching for "Command Prompt" in the "Start" menu and then right-clicking on it and selecting "Run as administrator".

CMD

check the current Node version that is installed on Windows machine by using the "-v" option in the Command Prompt.

v

We are currently using node “v18.12.1” on Windows. Use the "nvm" command and specify the version we want to wish to install. For example, if we want to switch from Node version 18.12.1 to 18.5.0, simply execute the appropriate "nvm" command with the version number.

nvm install v18.5.0
Enter fullscreen mode Exit fullscreen mode

nvm install

Use the downgraded version, with the command:

nvm use 18.5.0
Enter fullscreen mode Exit fullscreen mode

nvm use

After downgrading the Node version using NVM, it is important to verify whether the downgrade was successful or not. To do this, check the Node version again using the same command as before.

node -v
Enter fullscreen mode Exit fullscreen mode

NODE

That's it! if the output displays the version number that you specified during the downgrade process, then it indicates that you have successfully downgraded the Node version using NVM. Great Job!

Now if we want to check all the Node versions that are currently installed on our Windows machine using NVM, simply execute the command

nvm list 
Enter fullscreen mode Exit fullscreen mode

This will give us a list of all the installed Node versions. To switch to a specific version that we want to use, use the "nvm use" command along with the version number just like we did above process.

We demonstrate the simplest and most commonly used method to downgrade Node version on a Windows machine. Follow the steps carefully and we'll be able to successfully switch to the desired version. Thanks for reading this article. HAPPY CODING 🚀!!

Top comments (0)