Skip to content

Instantly share code, notes, and snippets.

@vishalkakadiya
Last active December 31, 2020 11:40
Show Gist options
  • Save vishalkakadiya/1a31e659575055cb2942104fb8eae6ff to your computer and use it in GitHub Desktop.
Save vishalkakadiya/1a31e659575055cb2942104fb8eae6ff to your computer and use it in GitHub Desktop.
Downgrade and Upgrade Node in MAC

These days if you want to install a different version of node you do it this way:

First search for your desired package:

brew search node

This might give you the follow results:

heroku/brew/heroku-node ✔
llnode
node@10
nodebrew
leafnode
node ✔
node@8

....

And then install the desired version:

brew install node@8

Also remember that you can install more than 1 node package at the same time, but you cannot have them available at the same time. So if you have the latest/generic node package already installed you need to unlink it first:

brew unlink node

And then you can link a different version:

brew link node@8

For some older node versions (which are keg-only), it might be required to link them with the --force and --overwrite options:

brew link --force --overwrite node@8

Ref: https://apple.stackexchange.com/questions/171530/how-do-i-downgrade-node-or-install-a-specific-previous-version-using-homebrew/207883#207883?newreg=2a42580e9bce4229959f624400111bb9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment