install NVM

    公司一般只会用某个版本的Node,自己想体验一下高版本的特性,所以想在windows上安装两个版本的node。NPM不行,所以选择的的NVM(Node Version Management)来管理多个Node版本。

1.NVM下载链接

https://github.com/coreybutler/nvm-windows/releases


2.下载、解压后是.exe文件,双击执行即可。

若当前有通过NPM安装的Node版本,NVM在安装过程中会安装一个对应的自己管理的版本。(这个在安装完之后可以在安装目录中看到)


3.设置代理(如果公司有代理需要设置)(from https://github.com/creationix/nvm/issues/973)

具体IP什么的可以查看之前NPM设置过的代理.npmrc文件

export http_proxy=username:password@proxy-server-your-company.com:port
export https_proxy=username:password@proxy-server-your-company.com:port
export NVM_NODEJS_ORG_MIRROR=https://nodejs.org/dist

4.如果没有代理,跳过第三步

通过nvm install <指定的node版本>。eg. nvm install 6.7.0


6. 上面的 nvm use xxx版本是当前window的默认全局版本

若是IDE,则可以自己指定相关版本



5. NVM相关命令



For linux :

reference:

1. https://github.com/creationix/nvm  --git install

2.http://blog.sina.com.cn/s/blog_a3fb1fe30102wgrk.html

If you have git installed (requires git v1.7.10+):

  1. clone this repo in the root of your user profile
  • cd ~/ from anywhere then git clone https://github.com/creationix/nvm.git .nvm
  1. cd ~/.nvm and check out the latest version with git checkout v0.33.11
  2. activate nvm by sourcing it from your shell: . nvm.sh

            4. 配置终端启动时自动执行 source ~/git/nvm/nvm.sh,

在 ~/.bashrc, ~/.bash_profile, ~/.profile, 或者 ~/.zshrc 文件添加以下命令:

source ~/git/nvm/nvm.sh



评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值