Last active
July 4, 2018 09:06
-
-
Save kugaevsky/68a7fa894551da9c310a to your computer and use it in GitHub Desktop.
Reverting back to node 0.10.36 on Mac OS X with Homebrew
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cd /usr/local | |
$ git checkout b64d9b9c431642a7dd8d85c8de5a530f2c79d924 Library/Formula/node.rb | |
$ brew unlink node | |
$ brew install node | |
$ npm install -g npm@latest |
This worked for me. My node version is back to 0.10.xx
But when I 'brew update', I get this error:
error: Your local changes to the following files would be overwritten by merge: Library/Formula/node.rb Please, commit your changes or stash them before you can merge. Aborting Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master
Anyone know how to fix this? Thanks.
I ran into the same need and ended up trying nvm
(Node Version Manager) instead. Fingers crossed.
@flipjs git checkout path-to/Library/Formula/node.rb
should resolve your issue.
Another solution to revert back to the latest node 0.10:
brew unlink node
brew install https://raw.githubusercontent.com/Homebrew/homebrew-versions/master/node010.rb
npm install -g npm@latest
@kugaevsky, this helped me. Thank you!
@kugaevsky I get this error when I run the 2nd git command:
``fatal: reference is not a tree: b64d9b9c431642a7dd8d85c8de5a530f2c79d924`
You save me~
@hchouhan, solution from @lloydde is working in this case.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Awesome! I could also keep a newer and an older version of node at the same time!
Just do the same as above:
$ cd /usr/local $ git checkout b64d9b9c431642a7dd8d85c8de5a530f2c79d924 Library/Formula/node.rb $ brew unlink node $ brew install node $ npm install -g npm@latest
Then use
brew switch
:$ brew switch node 0.12.2_1 Cleaning /usr/local/Cellar/node/0.10.36 Cleaning /usr/local/Cellar/node/0.12.2_1 6 links created for /usr/local/Cellar/node/0.12.2_1 $ node -v v0.12.2
and switch back again!
$ brew switch node 0.10.36 Cleaning /usr/local/Cellar/node/0.10.36 Cleaning /usr/local/Cellar/node/0.12.2_1 5 links created for /usr/local/Cellar/node/0.10.36 $ node -v v0.10.36
Very powerful indeed.