I'm using brew. I have node installed, using brew. I want to use an earlier version of node.
Online, I find instructions such as, for example:
cd /usr/local/Library/Formula
brew remove node --force
brew versions node
git checkout 83988e4 /usr/local/Library/Formula/node.rb
brew install node
The problem I have with this is that brew
doesn't seem to have a versions
subcommand:
$ brew versions node
Error: Unknown command: versions
$ brew --version
0.9.5
I'm new to brew. Do I need to enable the versions
subcommand somehow? Should I use a different subcommand instead? Is there a completely different method I should try?
I'm running OS X Yosemite (10.10.1); brew 0.9.5.
Best Answer
These days if you want to install a different version of
node
you do it this way:First search for your desired package:
This might give you the follow results:
And then install the desired version:
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:And then you can link a different version:
For some older node versions (which are keg-only), it might be required to link them with the
--force
and--overwrite
options: