Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I downgrade Node using NPM?

I need to downgrade my Node version from 10.x to 8.12. It appears I should be able to run this command:

$ npm install [email protected]

That runs, says removed 1 package, updates 1 package...

But then I check version and it keeps returning my old version:

$ node -v

v10.11.0

Am I doing something wrong or misunderstanding the commands/process?

like image 999
DA. Avatar asked Oct 23 '18 21:10

DA.


People also ask

Can we downgrade node version?

Can we downgrade node version? Nodejs can be upgraded or downgraded using different methods some of them are by manually downloading the latest version of node from their official nodejs.org website and the second method is by using nvm which is really helpful in controlling the node version.

How do I change node version in npm?

If you want to switch to the different version of Node, just type n in the terminal and you should see the Node versions listed. Use arrow keys to choose the version and press enter.


1 Answers

I am sheepishly answering my own question.

The issue was that node was a global install. Therefore, I needed to install the lower version globally ala the -g option:

$ npm install -g [email protected]

like image 66
DA. Avatar answered Sep 17 '22 20:09

DA.