brew install specific version of formula

Lets say we want to install (or downgrade to) node 0.6.19 instead of the newest version.

If you already have node, uninstall current version with:

$ brew uninstall node

Then search for available versions of the formula:

$ brew versions node
0.8.3    git checkout 31f8d9f Library/Formula/node.rb
0.8.2    git checkout 50ae8e4 Library/Formula/node.rb
0.8.1    git checkout 9ff0a1d Library/Formula/node.rb
0.8.0    git checkout 01f8006 Library/Formula/node.rb
0.6.19   git checkout 83988e4 Library/Formula/node.rb

Now checkout the desired version. Assuming you're at /usr/local/(我们必须切换到/usr/local/Library/Formula/下才能有效,楼主已亲测):

$ git checkout 83988e4 Library/Formula/node.rb

Finally install node:

$ brew install node

Done!

你可能感兴趣的:(MacOSX)