码迷,mamicode.com
首页 > 其他好文 > 详细

brew 安装旧版的node

时间:2015-08-12 10:21:33      阅读:738      评论:0      收藏:0      [点我收藏+]

标签:

brew详解:http://stackoverflow.com/questions/3987683/homebrew-install-specific-version-of-formula
最终我使用的命令:
1. 查看当前node版本
$ ls -l `which node`
lrwxr-xr-x  1 cyper  admin  30 Jul 26 12:09 /usr/local/bin/node -> ../Cellar/node/0.12.7/bin/node

2. 查看已经安装过的所有版本

$ ls /usr/local/Cellar/node*
/usr/local/Cellar/node:
0.12.7

/usr/local/Cellar/node010:
0.10.40

3。查看某个node标签的详细信息
 $ brew info node
或brew info node010

4。如果从第二步的结果中可以找到0.10.40的node,则可以直接switch过去
$ brew switch node010 0.10.40

4. 如果先前没有安装0.10的版本,可以查看所有可用的版本,从这里可以找到homebrew/versions/node010,这正是我后面安装所需要的版本。
 $brew search node

5. 直接安装会提示必须先unlink现有的符号连接
 $ brew unlink node

6. unlink后再安装就开始下载并安装了。
 $ brew install homebrew/versions/node010
==> Installing node010 from homebrew/homebrew-versions
==> Downloading https://homebrew.bintray.com/bottles-versions/node010-0.10.40.yosemite.bottle.tar.gz

7. 查看node
$ node -v
0.10.40


###版本切换测试

$ brew unlink node010
Unlinking /usr/local/Cellar/node010/0.10.40... 6 symlinks removed
 $ brew switch node 0.12.7
Cleaning /usr/local/Cellar/node/0.12.7
6 links created for /usr/local/Cellar/node/0.12.7
 $ brew unlink node
Unlinking /usr/local/Cellar/node/0.12.7... 7 symlinks removed
 $ brew switch node 0.10.40
Error: node does not have a version "0.10.40" in the Cellar.
Versions available: 0.12.7
 $ brew switch node010 0.10.40
Cleaning /usr/local/Cellar/node010/0.10.40
5 links created for /usr/local/Cellar/node010/0.10.40
 $ node -v
v0.10.40







brew 安装旧版的node

标签:

原文地址:http://my.oschina.net/uniquejava/blog/491030

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!