摘要

nvm可以。brew怎么去切换不同的node版本

转载请注明出处:http://my.oschina.net/uniquejava/blog/491030

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

或者用
➜  ~  $ brew switch node fuck
Error: node does not have a version "fuck" in the Cellar.
Versions available: 0.12.7, 5.3.0
➜  ~  $

然后就可以用
brew unlink node && brew switch node 0.12.7这样的命令直接切过去了!!!!

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

8. 如果是全新安装:

先执行brew search node 
然后执行brew install homebrew/versions/node010

9. brew设置http代理:
执行man brew再搜索proxy就可以找到解决办法
tools can download via a proxy. It's common for these tools to read  proxy  parameters  from environment variables.

For  the majority of cases setting http_proxy is enough. You can set this in your shell profile, or you can use it before a brew command:

http_proxy=http://<host>:<port> brew install foo

If your proxy requires authentication:

http_proxy=http://<user>:<password>@<host>:<port> brew install foo

© 著作权归作者所有

brew管理node的版本的更多相关文章

  1. 让 Homebrew 走代理更新 + brew 管理 node 版本

    0.前言 环境:MacOS 背景:整理下今天所做的配置. 1. 让 Homebrew 走代理更新 brew update 就卡住了,即使开了 shadowsocks 也不行.因为 shadowsock ...

  2. Mac下nvm管理node.js版本问题

    本篇文章主要是针对已经安装了node.js和nvm管理工具小伙伴遇到的问题. 管理工具有两个,一个是nvm,还有一个是nnvm的好处就是可以管理多个node版本,而且可以切换想要的版本,可以安装一个稳 ...

  3. windows使用nvm管理node不同版本

    最近项目需要升级,新技术需要的node版本较高,而新node不兼容旧版本node,而原项目仍需要继续维护,所以就需要在本地有多个版本的node,基本原理是在环境配置中修改系统变量node的版本文件夹路 ...

  4. 管理node的版本

    检查当前node的版本 node -v 清除npm cache sudo npm cache clean -f 安装n模块 sudo npm install -g n 切换到别的版本,比如 v4.4. ...

  5. 使用nvm管理node.js版本以及更换npm淘宝镜像源

    目录 1,前言 2,安装nvm 3,nvm的使用 4,错误处理 5,修改npm默认镜像源 6,win10下cnpm报错 1,前言 注意:此教程仅限Windows,Mac可能不适用 在我们的日常开发中可 ...

  6. 使用nvm管理node不同版本,安装,环境配置,切换不同版本的node版本

    文章包含以下内容: 一.下载地址 二.nvm-noinstall.zip安装 三.nvm-setup.zip安装 四.测试安装以及使用 一.下载地址 https://github.com/coreyb ...

  7. 利用n和nvm管理Node的版本

    写在前面 Node版本的迭代速度很快,版本很多(横跨0.6到0.11),升级Node版本成为了一个问题.目前有n和nvm这两个工具可以对Node进行无痛升级,本文简单介绍一下二者的使用. n n是No ...

  8. 管理node.js版本的模块:n

    n模块的使用: 命令 作用 yarn global add n 全局安装n n stable 升级node.js到最新稳定版 n v0.10.26 或 n 0.10.26 升级到指定版本号

  9. Nodejs - 交互式管理 Node.js 版本

    n - npm:Interactively Manage Your Node.js Versions. Unfortunately n is not supported on Windows. npm ...

随机推荐

  1. git用法之常用命令

    1.git 安装好后,如何配置? a: 设置本地用户名.邮箱,很重要!之后的每次提交都会用到这两条信息,说明是谁提交了更新. $ git config --global user.name " ...

  2. 怎样在Windows资源管理器中添加右键菜单以及修改右键菜单顺序

    有时,我们需要在Windows资源管理器的右键菜单中添加一些项,以方便使用某些功能或程序. 比如我的电脑上有一个免安装版的Notepad++,我想在所有文件的右键菜单中添加一项用Notepad++打开 ...

  3. 在Qt Creator 和在 vs2012 里添加信号和槽

    原文地址:http://www.cnblogs.com/li-peng/p/3644812.html 作者:李鹏 出处:http://www.cnblogs.com/li-peng/ 本文版权归作者和 ...

  4. Java中的24种设计模式与7大原则

    一.创建型模式 1.抽象工厂模式(Abstract factory pattern): 提供一个接口, 用于创建相关或依赖对象的家族, 而不需要指定具体类.2.生成器模式(Builder patter ...

  5. filter : progid:DXImageTransform.Microsoft.AlphaImageLoader ( enabled=bEnabled , sizingMethod=sSize , src=sURL )

    很多时候需要将图片显示在网页上,一般都会这样做,如下: <img src="xxx.jpg"/> 是的,这样是可以做到,但是如果我要将本地的图片显示到页面上呢?你可能会 ...

  6. WPF 中的image控件的Source如何赋值

    Image image=new Image();image.Source = new BitmapImage(new Uri(@"daw\adw.jpg",UriKind.Rela ...

  7. Git使用教程

    配置Git 首先在本地创建ssh key: $ ssh-keygen -t rsa -C "your_email@youremail.com" 后面的your_email@your ...

  8. mui学习记录

    1.页面间传值 2.mui如何增加自定义icon图标 http://ask.dcloud.net.cn/article/128 3.设计基于HTML5的APP登录功能及安全调用接口的方式(原理篇) h ...

  9. DataTable导出到Excel

    简单的导出到Excel中: 代码如下: using System; using System.Collections.Generic; using System.Data; using System. ...

  10. mysql优化(初学)

    写的时候遇到了SQL语句的优化问题,在网上搜了一些学习.http://blog.csdn.net/kennyrose/article/details/7532032 索引: 1.可以在这些列上创建索引 ...