Как понизить версию node js windows

Как откатить node до старой версии в Windows, как переключить версии node в Windows | How to change node version in Windows

Встречались ли вы с ситуацией, когда какой-нибудь ваш проект требует версию node.js меньше, чем у вас установлена. На UNIX системах переключить версию node сравнительно легко. А вот для Windows немного сложнее. Ниже описан один из самых лёгких способов это сделать.

Для начала качаем NVM (Node Version Manager) для Windows по ссылке. Там среди прочей информации о версиях, будут предложены несколько инсталлях, в том числе для обновления уже установленного NVM. Для случая «с нуля» выбираем nvm-setup.zip (или как он будет зваться в дальнейшем) и ставим. Дальше лучше перезагрузить систему.

Свидетельством успешной установки будет работоспособность в терминале команды nvm version. Она должна нам вывести нечто подобное:

nvm version
1.1.9

Теперь, если мы проверим наличие всех установленных версий node и текущую, введём nvm list

nvm list
16.13.1

Допустим, нам для проекта нужна версия node 14. Ставим её:

nvm install 14

Установится версия 14.19.0 — последняя в серии 14. Если хотим установить конкретную версию, указываем это в nvm-команде.

Сейчас, если мы посмотрим список установленных версий, то увидим следующее:

nvm list
16.13.1
14.19.0

Чтобы переключиться на нужную версию из уже имеющихся, вводим:

nvm use 14.19.0

Теперь эта версия будет актуальной и чтобы вернуться к прежней, используем те же команды.

@fruntend_news  - будьте в курсе самых свежих новостей из мира FrontEnd

Будь в курсе свежих новостей

Introduction

Developers use the Node.js runtime environment to build server-side and networking applications using JavaScript. To guarantee optimal performance and security, you need to update Node.js to the latest version regularly.

However, developers sometimes need to downgrade Node to a previous version when they encounter compatibility issues with dependencies or when a project requires a specific release.

Learn how to downgrade the Node version in Windows and manage multiple Node.js versions on a machine.

Developer attempting to downgrade Node.js.

Prerequisites

  • Access to the Windows command prompt (CMD) or PowerShell.
  • Administrator privileges.

Removing an existing Node distribution and reinstalling a previous version whenever you have a different project is impractical.

The nvm (Node Version Manager) tool enables developers to install different versions of Node side-by-side and switch between these versions via the Windows command line.

Note: Having two concurrent Node distributions, one installed using nvm and another using npm, may lead to compatibility issues. It is recommended to uninstall existing Node versions before installing nvm.

Step 1: Uninstall Existing Node Version

To remove a Node.js version from your Windows system:

1. Type Control Panel in the search box on the taskbar.

2. Open the Control Panel app.

Access Control Panel in Windows.

3. Click Uninstall a program in the Programs category.

Uninstall Node app in Windows.

4. Select the Node.js installation.

5. Click Uninstall.

Steps to uninstall Node in Windows.

The Windows Installer proceeds to uninstall Node.js. Follow on-screen prompts to ensure the process runs its course and that the current Node.js version is completely removed from your Windows system.

Step 2: Install nvm on Windows

To install nvm on Windows:

1. Use a browser to access the nvm GitHub repository.

2. Download the latest nvm installer by clicking nvm-setup.exe in the Assets section.

Downloading the nvm installer from GitHub.

3. Locate the installer on your local machine and double-click to start the installation.

Initiate the nvm installation process.

4. Select I accept the agreement.

5. Click Next.

Accept nvm license agreement.

6. Choose an nvm installation path and select Next.

Set the nvm installation path.

7. Keep the default path or define a custom symlink for the active Node.js version.

8. Click Next.

Set the Node.js symlink path.

9. Select Install.

Install nvm on Windows.

10. Click Finish.

Finish nvm installation process on Windows.

The nvm installation process is complete.

Step 3: Use nvm to Install Node

Managing Node.js versions via nvm requires administrator privileges for the Windows command prompt (CMD) or PowerShell.

To install a specific Node version using cmd:

1. Type cmd in the search bar and select Run as administrator.

Open Windows cmd as an administrator.

2. List the available Node versions using the following command:

nvm list available
A list of available Node.js versions.

Identify the version you want to install and note the version number.

3. To install a specific version, use the following command (replace x.x.x with the version number):

nvm install x.x.x

For example, to install Node.js version 16.14.1, type:

nvm install 16.14.1
Install specific Node version using nvm.

The system confirms that the installation is complete.

To install the latest available Node version, enter:

nvm install latest
Installing the latest Node version on Widows.

Note: Every time you use nvm to install a new Node.js version, the tool also installs the corresponding npm version by default.

To install the latest stable version, which is recommended for most users, type:

nvm install lts
Installing the latest stable Node.js version using nvm.

To start using the lts version, enter the following command:

nvm use lts
Start using the Node lts version in Windows.

The system confirms the Node version currently being used.

Step 4: Downgrade Node Version

To downgrade a Node version, type the following command::

nvm use x.x.x

Replace x.x.x with a version number.

Note: Ensure that the version you want to use is already installed.

For example, to start using a previously installed version, 16.14.1, enter:

nvm use 16.14.1
Using nvm to downgrade Node.js version in Windows.

You have successfully downgraded the Node.js version on Windows using nvm.

Step 5: Check Current Node Version

To verify the system is using the correct Node version, run the following command:

node -v
Check Node version using the Windows cmd.

The version number is shown in the terminal.

To confirm the npm version, type:

npm -v
Check npm version in Windows using the command prompt.

The system displays the npm version.

How to Switch Between Node Versions

Before switching between Node versions, list the versions installed on your Windows machine.

1. Use the following command to list installed Node versions:

nvm list

2. Switch to a different Node version from the list. For example:

nvm use 20.2.0

3. List installed Node versions again to confirm the correct version is actively used:

nvm list
Steps to switch between Node versions in Windows.

The asterisk (*) symbol shows which Node.js version the system currently uses.

Conclusion

Now you know how to downgrade and manage Node.js versions on Windows using the nvm tool.

Use this knowledge to quickly switch between Node versions based on project requirements and avoid potential compatibility issues.

Cover image for 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 🚀!!

I want to downgrade my Node version from the latest to v6.10.3.

But nothing has worked so far. Tried NVM and it gives an error as well by saying that the make command is not found. How can I downgrade Node?

ouflak's user avatar

ouflak

2,45810 gold badges44 silver badges49 bronze badges

asked Oct 30, 2017 at 4:29

Shashika Virajh's user avatar

Shashika VirajhShashika Virajh

8,58718 gold badges59 silver badges103 bronze badges

2

Warning:
This answer does not support Windows OS

You can use n for node’s version management. There is a simple intro for n.

$ npm install -g n
$ n 6.10.3

this is very easy to use.

then you can show your node version:

$ node -v
v6.10.3

For windows nvm is a well-received tool.

Charlie's user avatar

Charlie

3,1334 gold badges39 silver badges63 bronze badges

answered May 11, 2018 at 7:44

aircraft's user avatar

18

For windows:

Steps

  1. Go to Control panel> program and features>Node.js then uninstall

  2. Go to website: https://nodejs.org/en/ and download the version and install.

skillsmuggler's user avatar

answered Jun 18, 2019 at 11:40

Dharmendra Singh Pokhariya's user avatar

2

Determining your Node version

node -v  // or node --version
npm -v   // npm version or long npm --version

Ensure that you have n installed

sudo npm install -g n // -g for global installation 

Upgrading to the latest stable version

sudo n stable

Changing to a specific version

sudo n 10.16.0

Answer inspired by this article.

answered Feb 18, 2020 at 9:38

Khaled Lela's user avatar

Khaled LelaKhaled Lela

7,8616 gold badges45 silver badges73 bronze badges

8

In Mac there is a fast method with brew:

brew search node

You see some version, for example: node@10 node@12 … Then

brew unlink node

And now select a before version for example node@12

brew link --overwrite --force node@12

Ready, you have downgraded you node version.

answered Apr 28, 2020 at 23:18

Kike Gamboa's user avatar

Kike GamboaKike Gamboa

9947 silver badges8 bronze badges

3

This may be due to version incompatibility between your code and the version you have installed.

In my case I was using v8.12.0 for development (locally) and installed latest version v13.7.0 on the server.

So using nvm I switched the node version to v8.12.0 with the below command:

> nvm install 8.12.0 // to install the version I wanted

> nvm use 8.12.0  // use the installed version

NOTE: You need to install nvm on your system to use nvm.

You should try this solution before trying solutions like installing build-essentials or uninstalling the current node version because you could switch between versions easily than reverting all the installations/uninstallations that you’ve done.

answered Feb 4, 2020 at 5:59

itsHarshad's user avatar

itsHarshaditsHarshad

1,51914 silver badges16 bronze badges

0

For windows 10,

  • Uninstalling the node from the «Add or remove programs»
  • Installing the required version from https://nodejs.org/en/

worked for me.

answered Nov 28, 2019 at 8:25

Sasi Kumar M's user avatar

Sasi Kumar MSasi Kumar M

2,4801 gold badge23 silver badges23 bronze badges

3

 curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
 sudo npm install -g n
 sudo n 10.15
 npm install
 npm audit fix
 npm start

answered Jun 17, 2019 at 7:06

Hariharan AR's user avatar

Hariharan ARHariharan AR

1,40613 silver badges20 bronze badges

If you’re on Windows I suggest manually uninstalling node and installing chocolatey to handle your node installation. choco is a great CLI for provisioning a ton of popular software.

Then you can just do,

choco install nodejs --version $VersionNumber

and if you already have it installed via chocolatey you can do,

choco uninstall nodejs 
choco install nodejs --version $VersionNumber

For example,

choco uninstall nodejs
choco install nodejs --version 12.9.1

answered Feb 5, 2020 at 20:58

kayleeFrye_onDeck's user avatar

1

If you are on macOS and are not using NVM, the simplest way is to run the installer that comes from node.js web site. It it clever enough to manage substitution of your current installation with the new one, even if it is an older one. At least this worked for me.

answered Nov 27, 2017 at 8:33

sertal70's user avatar

sertal70sertal70

4933 silver badges10 bronze badges

1

Try using the following commands

//For make issues 
sudo apt-get install build-essential

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.4/install.sh | bash

//To uninstall a node version 
nvm uninstall <current version>

nvm install 6.10.3

nvm use 6.10.3

//check with 
node -v

answered Oct 30, 2017 at 5:08

Kalana Demel's user avatar

Kalana DemelKalana Demel

3,2303 gold badges21 silver badges34 bronze badges

1

Steps to downgrade to node8

brew install node@8
brew link node@8 --force

if warning remove the folder and files as indicated in the warning then again the command :

brew link node@8 --force

Suraj Rao's user avatar

Suraj Rao

29.4k11 gold badges94 silver badges103 bronze badges

answered Oct 6, 2018 at 9:53

Fabien Thetis's user avatar

2

For windows users, you guys can downgrade using following commands.

npm uninstall -g node

npm install -g node@version

@version is your specified version, example : 12.22.3(little old)

Can find node releases here https://nodejs.org/en/download/releases/

answered Sep 13, 2021 at 9:57

Arya Mohanan's user avatar

I have used brew in mac to downgrade the node

follow the steps you will have the result:

  1. brew search node (here you can see the version eg: node@10, node@12, node@14)
  2. brew unlink node
  3. brew install < node version > (eg: node@12)
  4. brew link —overwrite node@12

answered Feb 28, 2021 at 19:01

Ashutosh Ranjan's user avatar

If you are using nvm, following are the ways —

1. nvm install node_version
2. nvm use --delete-prefix node_version

For more insights, see this image —
enter image description here

answered Jan 12, 2022 at 7:53

Suprabhat Kumar's user avatar

Ubuntu:

nvm list
nvm use <version>

nvm list // Shows all the versions on your machine. Of course have your version installed.

nvm use // Use this version

answered Nov 8, 2021 at 11:03

Jacques Koorts's user avatar

Jacques KoortsJacques Koorts

1,8191 gold badge17 silver badges10 bronze badges

In case of windows, one of the options you have is to uninstall current version of Node. Then, go to the node website and download the desired version and install this last one instead.

answered Feb 18, 2019 at 16:52

Alberto S.'s user avatar

Alberto S.Alberto S.

1,84524 silver badges39 bronze badges

0

it seems to be a compatibility issue, run

sudo n 14

then npm install or yarn install again. It will work

answered Aug 23, 2022 at 15:11

Xavi Nguyen's user avatar

WINDOWS: Best way that you can do it and to not lose time.

  1. Go to control panel
  2. Uninstall Program
  3. Uninstall node
  4. Then go and find the version that you want to install, install it from the beginning.

Link with node versions: https://nodejs.org/uk/blog/release/

answered Dec 31, 2022 at 14:07

Ilir Shala's user avatar

1

The Node.js team suggests to use the following Node.js version managers to switch between different versions of Node:

OSX or Linux:

  • nvm
  • n

Windows:

  • nodist
  • nvm-windows

I personally made good experiences using «nvm-windows» on Windows 11.

answered Jun 2, 2022 at 15:41

Benny Code's user avatar

Benny CodeBenny Code

51.8k28 gold badges236 silver badges199 bronze badges

I had to downgrade node to v10.16.0

sudo n 10.16.0

nvm use v10.16.0

this solved the problem for me

Tyler2P's user avatar

Tyler2P

2,32426 gold badges23 silver badges31 bronze badges

answered Oct 26, 2022 at 9:59

INDRA's user avatar

INDRAINDRA

113 bronze badges

I too wanted to downgrade my node version (v18.13.0) to a stable version(v16.10.0). So I followed these steps in my windows OS:

  1. First I installed nvm to my computer, cause I hadn’t installed it. Go through this link. And I downloaded nvm-setup.exe one. Choose your suitable version. After downloading the setup file, launch the installation wizard and follow the on-screen directions to install nvm.
  2. Then add the nvm installation directory to your system’s PATH environment variable. Like: C:\Users\damik\AppData\Roaming\nvm
  3. Next you can type nvm in your cmd and you can clarify the installation of nvm.
  4. Then uninstall the current version of Node.js. i.e.: nvm uninstall v18.13.0. First check your node.js and add relevant version here.
  5. Now Node.js has been uninstalled, you can install the version you want using this command: nvm install v16.10.0 . Please install the relevant version here.
  6. After the installation is complete, run the following command to make the version you just loaded the default Node.js version. nvm use v16.10.0
  7. This command will make the present shell session’s version the default. You can use the nvm alias default v16.10.0 to make this version the default for all new shell sessions:
  8. Check your node version by node -v. And now it’s all ok ;)

answered Mar 24 at 17:36

Damika's user avatar

DamikaDamika

6622 gold badges8 silver badges17 bronze badges

1

use nvm from this link and install it. then use nvm install <version name> of your desired node version to install it. Finally write nvm use <version name> on your terminal to switch to your desired version number.

answered Jul 30 at 7:39

Abey Bruck's user avatar

Abey BruckAbey Bruck

5325 silver badges7 bronze badges

This is for Windows machines. some are suggesting installing nvm which isn’t required.

I had node version 18 installed and had to move to a lower version 16.

  1. npm uninstall -g node

  2. npm install -g [email protected]

  3. Close the cmd prompt and open a new one.

  4. node -v

You will see now it will show 16.20.0

Here is the list of all versions. https://nodejs.org/en/download/releases

thanks

answered Sep 25 at 9:44

Mukesh Salaria's user avatar

Mukesh SalariaMukesh Salaria

3,4211 gold badge17 silver badges21 bronze badges

Asked

Viewed
68k times

I want to downgrade my version using npm.
The current version is 16.13.1. I want to downgrade this to 12.0.1. Can anyone tell me how to do it?

Thanks!

  • node.js
  • angular
  • npm

asked Dec 23, 2021 at 5:41

Priya's user avatar

PriyaPriya

1871 gold badge2 silver badges10 bronze badges

3

  • Use a version management tool (e.g. asdf, volta, nvm).

    Dec 23, 2021 at 6:11

8 Answers

answered Dec 23, 2021 at 5:50

Dako patel's user avatar

Dako patelDako patel

7604 silver badges13 bronze badges

1

  • While this is useful, a better answer would include an example with nvm to downgrade Node~

    Aug 12, 2022 at 1:56

You can accomplish that with Node Version Manager. Install nvm first, and in a terminal:

nvm install 12.0.1

Then

nvm use 12.0.1

answered May 3, 2022 at 19:17

J.dev's user avatar

J.devJ.dev

8443 gold badges12 silver badges22 bronze badges

You can use: npm install -g node@version.

So for example in your case it would be -> sudo npm install -g [email protected]

might have to force it with --force at the end.

Tyler2P's user avatar

Tyler2P

2,32426 gold badges23 silver badges31 bronze badges

answered May 3, 2022 at 18:42

Brian Nieckarz's user avatar

1

  • I tried running that command — both with —force and without — I get a 404 error GET https://registry.npmjs.org/16.20.2 - Not found

    Oct 4 at 17:00

Clearing the local installation of node, to find out where is and delete

where node

Install nvm

For Windows

For others

Show all the versions

nvm ls available

Install what you want

nvm install 12.0.1
nvm use 12.0.1

Check node version

node -v

I have tried several ways and this works, hope it helps.

answered Nov 20, 2022 at 11:14

Ming's user avatar

You could also install the node npm module to change (upgrade or downgrade) the NodeJS version for the specific project.

answered Dec 23, 2021 at 6:06

code's user avatar

codecode

5,7484 gold badges18 silver badges39 bronze badges

first check your node version

node -v
sudo npm install -g n
sudo n stable
sudo n 14.6.0 (you can chnage version here as you want to move)
npm install (jst run after all)

now you can check the node and npm version by

 node -v
 npm -v

answered Aug 10, 2022 at 10:46

Deepak's user avatar

0

Try the n package from npm. Find it here.

npm install -g n

n 10.16.0
n lts

Simply execute n <version> to download and install a version of Node.js. If has already been downloaded, n will install from its cache.

answered May 3, 2022 at 19:08

Ivan Bacher's user avatar

Ivan BacherIvan Bacher

5,8959 gold badges36 silver badges58 bronze badges

I finally found a simple solution.

  1. Uninstall the current Version
  2. Download the version you want.

It works fine for me.

Thanks!

answered Dec 23, 2021 at 5:56

Priya's user avatar

PriyaPriya

1871 gold badge2 silver badges10 bronze badges

  • The Overflow Blog
  • Featured on Meta

Linked

Related

Hot Network Questions

  • Is Emptiness empty of Dhammas?

  • Why do some Chinese shows avoid using real toponyms?

  • As an antonym of 前景 («foreground»), is it better to use 后景 or 背景?

  • What do countries gain from UN peacekeeping deployment?

  • What should one do to help Israel during war?

  • Business Schengen Visa for Tourism Purpose

  • Movie involving a crashed/landed alien craft in an icy cavern

  • How to take good photos of stars out of a cockpit window using the Samsung 21 ultra?

  • Early 1980s short story (in Asimov’s, probably) — Young woman consults with «Eliza» program, and gives it anxiety

  • Eliminating one variable from two simple polynomial equations

  • Typical and minimum ground-pedal clearance

  • Best practice for if-elif-else statements

  • Fungus gnats or thrips?

  • How can I make onboard PC speaker beep on Ubuntu Server 22.04.3 LTS?

  • Does general linear model includes interaction?

  • Why are jurors still asked to operate the law if their primary role is to find facts?

  • Colouring a rug

  • What is Hamas’ strategy in attacking Israel?

  • Meaning of «schon einmal»

  • What could be this 1990s MS-DOS (or maybe Windows) 3D FPS (Doom WAD maybe?) with floating gray spiky polyhedra that I think was set in cyberspace?

  • Why does causality imply that the system function is analytic?

  • Assumption of Normality — do the residuals need to be normally distributed for each independent variable (or each level of an IV)?

  • What makes some players so good?

  • How to draw the trajectory of the circumscribed rectangle of an ellipse and determine the area range of the rectangle?

more hot questions

Question feed

Your privacy

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.

  • Как понизить нагрузку на процессор на windows 10
  • Как понять где ssd а где hdd при установке windows
  • Как понять есть ли майнер на пк windows 10
  • Как понять есть ли блютуз на пк windows 10
  • Как понять активирована ли windows 10 или нет