473

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
  • 2,458
  • 10
  • 44
  • 49
Shashika Virajh
  • 8,497
  • 17
  • 59
  • 103
  • 1
    it looks like your package has been installed, but not added to the PATH. add path to your package and all will work fine – Raphael Jun 17 '19 at 07:20
  • https://github.com/facebook/create-react-app/issues/11562 has the details, why to downgrade NodeJs to v16.13.0 – Abhinav Saxena Dec 21 '21 at 08:35

24 Answers24

678

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
  • 3,113
  • 3
  • 38
  • 60
aircraft
  • 25,146
  • 28
  • 91
  • 166
  • 3
    In this [article](https://www.abeautifulsite.net/how-to-upgrade-or-downgrade-nodejs-using-npm) recommend to clean the npm cache first, but it works fine as above for me on mac. Command `sudo npm cache clean -f` – Rabel Obispo May 06 '19 at 13:47
  • didn't work for me in mac - says `The operation was rejected by your operating system.` Had to use `brew install n` – inquisitive Jan 02 '20 at 06:39
  • tried the same way, it does download but not installed, showing the older version on centos – Pankaj Bhandarkar Mar 04 '20 at 13:47
  • 9
    For Windows use this: https://github.com/coreybutler/nvm-windows to setup `nvm` and control Node version via it. – Arsen Khachaturyan Apr 23 '20 at 12:19
  • If you get a permission error, this is helpful: https://github.com/tj/n/issues/416#issuecomment-417808320 – Ryan Apr 25 '20 at 18:11
  • But how do I select a specific version? it’s not clear, there are 2 lines on your first suggestion – ofer2980 Apr 26 '20 at 11:19
  • 3
    @ofer2980, to make it work finally I did ```sudo n lts``` to demote to the last LTS and it fixed my issue. In general ```n ``` does the job – Davide C May 10 '20 at 11:18
  • Worked on Ubuntu! Thanks for this. – Vinay Somawat Jun 18 '20 at 11:54
  • 1
    this is not helpful at all. the question is how to downgrade, not switch version – Alan Yong Aug 10 '20 at 12:49
  • 13
    How do you change the active version? I installed it fine but cant change the active version – Grant Singleton May 05 '21 at 14:01
  • 2
    @GrantSingleton Same. This solution for Mac will install the version you specify but it will not automatically make it the active version. OP should update the answer – Ian Steffy May 06 '21 at 11:50
  • 1
    @IanS I ended up just using brew to uninstall the version I had and install the version I needed. I would have loved for n to be able to switch the active version. – Grant Singleton May 06 '21 at 13:29
  • 1
    @GrantSingleton I actually did the same thing yesterday. I brew uninstall node then used brew to install the new version, unlink the old version, link the new one, etc. I agree, but this has made me consider using brew much more. 'n use' would not switch to the new version of node even though n could download it. Perhaps the n and brew conflict in certain areas. – Ian Steffy May 07 '21 at 05:47
  • 1
    `n` didn't work for me either, but `nvm use ` did - e.g. https://stackoverflow.com/a/45632540/13488316 – Penguin Knees Sep 09 '21 at 17:55
  • https://github.com/facebook/create-react-app/issues/11562 has the details, why to downgrade NodeJs to v16.13.0 – Abhinav Saxena Dec 21 '21 at 08:32
  • Why would you use this? `nvm` is the standard node versioning tool. – Andy Ray Aug 24 '22 at 01:35
  • @GrantSingleton The issue is with the path. If you brew install node and then install n and use n to install a different node version, the active node version will be the one installed by brew since the brew path has priority. You can update the path to node in your bash or zshrc file to use the one installed by n, or can simply brew uninstall node after you installed the lower node version with n. – OctaviaLo Sep 20 '22 at 09:54
  • Would be great if you included the option for windows as well. Don't know how this is the chosen answer if all the people using windows are excluded. – Franco Feb 22 '23 at 07:44
169

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
  • 1,862
  • 1
  • 11
  • 16
167

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.

Khaled Lela
  • 7,831
  • 6
  • 45
  • 73
59

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.

Kike Gamboa
  • 994
  • 7
  • 8
48

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.

itsHarshad
  • 1,519
  • 14
  • 16
27

For windows 10,

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

worked for me.

Sasi Kumar M
  • 2,440
  • 1
  • 23
  • 23
23
 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
Hariharan AR
  • 1,386
  • 11
  • 20
20

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
kayleeFrye_onDeck
  • 6,648
  • 5
  • 69
  • 80
  • 2
    If you want to stick always to the **Node LTS** version (which might be the reason for the desired downgrade), then use the Chocolatey [nodejs-lts](https://community.chocolatey.org/packages/nodejs-lts) package instead. This offers the advantage to keep up-to-date with the latest supported LTS version. – Tobias May 14 '21 at 15:35
18

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.

sertal70
  • 493
  • 3
  • 10
  • 2
    Here is the official link with all node versions ever https://nodejs.org/dist/ You can use `CTRL+F` (`CMD+F` on Mac) to find exactly the version You need. Download the `.pkg` file if You are using a Mac and You are ready to go! :) – Aleksandar Oct 14 '19 at 11:36
16

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
Kalana Demel
  • 3,220
  • 3
  • 21
  • 34
  • notice: this installs ```nvm``` - a service that lets you have multiple node versions installed on you computer, and to set a node version for each project/folder – Shani Kehati Aug 04 '21 at 10:53
11

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
  • 29,388
  • 11
  • 94
  • 103
Fabien Thetis
  • 1,666
  • 15
  • 11
  • Worked for me perfectly - also the advantage is - you then have proper updates through brew but only for the selected release. You could have issues during the 'link' stage if you have leftovers from previous installations but you will be pointed where so it is easy to clean. – Roman Nikitchenko Jun 15 '20 at 08:10
  • `brew link node@8 --force --overwrite` solved the problem – Anton Lukin Jul 13 '20 at 20:07
11

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/

Arya Mohanan
  • 577
  • 5
  • 8
9

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
7

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

Suprabhat Kumar
  • 645
  • 7
  • 13
6

Here is a simple solution

  1. Go to this link and download & install the suitable nvm setup on your computer https://github.com/coreybutler/nvm-windows

  2. Type nvm list to get list of installed node versions

  3. Type nvm install <node-version>

  4. Type nvm use <version>

here we go you got node version you want.

Browse here to find node versions => https://nodejs.org/en/download/releases/

Sritharan
  • 61
  • 1
  • 3
5

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

Jacques Koorts
  • 1,819
  • 1
  • 17
  • 10
4

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.

Alberto S.
  • 1,805
  • 23
  • 39
4

it seems to be a compatibility issue, run

sudo n 14

then npm install or yarn install again. It will work

Xavi Nguyen
  • 129
  • 4
2

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/

Ilir Shala
  • 21
  • 1
  • Hi, your answer probably is acceptable, but other solutions make possible to pick a different version from time to time, without uninstalling anything – pierpy Dec 31 '22 at 14:42
1

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

OSX or Linux:

Windows:

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

Benny Code
  • 51,456
  • 28
  • 233
  • 198
1

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
  • 2,324
  • 26
  • 22
  • 31
INDRA
  • 11
  • 3
0

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 ;)
Damika
  • 622
  • 2
  • 8
  • 17
  • This doesn't appear to add anything new to the existing answers. When answering a question that is 6 years old, consider whether your answer gives any new information. – miken32 Mar 24 '23 at 17:50
0

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.

Abey Bruck
  • 532
  • 5
  • 7
-3

I would recommend using NVS (Node Version Switcher).

You can see the source here and all you need is a package manager. Like Chocolatey or Homebrew.

Install it

choco install nvs

Add a version:

nvs add v16

Switch to any version you installed

nvs use v16

At the end if you "run node -v" you'll get the current you've switched.

YanMax
  • 75
  • 4