How to downgrade Node version
Solution 1
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.
Solution 2
For windows:
Steps
Go to
Control panel> program and features>Node.js
then uninstallGo to website: https://nodejs.org/en/ and download the version and install.
Solution 3
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.
Solution 4
In Mac there is a fast method with brew:
brew search node
You see some version, for example: [email protected] [email protected] ... Then
brew unlink node
And now select a before version for example [email protected]
brew link --overwrite --force [email protected]
Ready, you have downgraded you node version.
Solution 5
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.
Related videos on Youtube

Shashika
Updated on February 05, 2022Comments
-
Shashika over 1 year
I want to downgrade my Node version from the latest to
v6.10.3
.But nothing worked so far. Tried NVM and it gives an error as well by saying make command is not found. How can I downgrade Node?
-
Raphael almost 4 yearsit looks like your package has been installed, but not added to the PATH. add path to your package and all will work fine
-
Abhinav Saxena over 1 yeargithub.com/facebook/create-react-app/issues/11562 has the details, why to downgrade NodeJs to v16.13.0
-
-
Thorbjørn Kappel Hansen almost 5 years
n
does not support Windows -
vijay over 4 yearsWork great on Mac
-
Rabel Obispo about 4 yearsIn this article recommend to clean the npm cache first, but it works fine as above for me on mac. Command
sudo npm cache clean -f
-
Aleksandar over 3 yearsHere is the official link with all node versions ever 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! :) -
inquisitive over 3 yearsdidn't work for me in mac - says
The operation was rejected by your operating system.
Had to usebrew install n
-
Ian Samz about 3 yearsthis was so fast
-
Pankaj Bhandarkar about 3 yearstried the same way, it does download but not installed, showing the older version on centos
-
Morten Nørgaard about 3 yearsFor those looking for an older version, these are found here, nodejs.org/dist
-
Arsen Khachaturyan about 3 yearsFor Windows use this: github.com/coreybutler/nvm-windows to setup
nvm
and control Node version via it. -
Ryan about 3 yearsIf you get a permission error, this is helpful: github.com/tj/n/issues/416#issuecomment-417808320
-
ofer2980 about 3 yearsBut how do I select a specific version? it’s not clear, there are 2 lines on your first suggestion
-
Davide C about 3 years@ofer2980, to make it work finally I did
sudo n lts
to demote to the last LTS and it fixed my issue. In generaln <version>
does the job -
Roman Nikitchenko almost 3 yearsWorked 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.
-
Vinay Somawat almost 3 yearsWorked on Ubuntu! Thanks for this.
-
Anton Lukin almost 3 years
brew link [email protected] --force --overwrite
solved the problem -
Alan Yong almost 3 yearsthis is not helpful at all. the question is how to downgrade, not switch version
-
Kishan Chaitanya over 2 yearstoo simple and fast ;)
-
adarian over 2 yearsHands down the best way of changing your version especially on a mac.
-
Mahdiyeh over 2 yearsAfter this I had to close the terminal and restart the Mac. Thank you, it was very helpful.
-
majordomo over 2 yearsDon't need to restart - just exit and open a new terminal session.
-
Barney Szabolcs over 2 yearsI've gotten
Error: No such keg: /usr/local/Cellar/[email protected]
-
Grant Singleton about 2 yearsHow do you change the active version? I installed it fine but cant change the active version
-
Ian Steffy about 2 years@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
-
Grant Singleton about 2 years@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.
-
Ian Steffy about 2 years@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.
-
Tobias about 2 yearsIf 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 package instead. This offers the advantage to keep up-to-date with the latest supported LTS version.
-
Fanchen Bao almost 2 yearsThe error means
[email protected]
has been installed yet.brew install [email protected]
and then do run the link command. -
Shani Kehati almost 2 yearsnotice: 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 -
Penguin Knees over 1 year
-
Baris C over 1 yearsudo n stable work for me thanks
-
pacoverflow over 1 year
sudo: n: command not found
-
Khaled Lela over 1 yearYou need to download n first, using command mentioned within the answer:
sudo npm install -g n // -g for global installation
-
Oliver Dixon over 1 yearnvm is much better, n causes so many issues.
-
Tomachi over 1 yearn is amazing. I could never get nvm to work. n works
-
Abhinav Saxena over 1 yeargithub.com/facebook/create-react-app/issues/11562 has the details, why to downgrade NodeJs to v16.13.0
-
Sham Gir over 1 yearin case of
sudo: n: command not found
use thissudo -E env "PATH=$PATH" n
e.g:sudo -E env "PATH=$PATH" n stable
askubuntu.com/questions/608661/… -
MoDzeus over 1 yearThis is absolute gold.