nodejs版本管理工具:Node Version Manager

nodejs版本管理工具。可以在多个nodejs版本中进行切换,降低了升级nodejs时的成本。

项目主页:https://github.com/creationix/nvm

安装方式:1、

curl https://raw.githubusercontent.com/creationix/nvm/v0.23.3/install.sh | bash

                2、

wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.23.3/install.sh | bash

                3、

git clone https://github.com/creationix/nvm.git ~/.nvm && cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`

安装完毕执行:

source ~/.nvm/nvm.sh


使用方法概述:

To download, compile, and install the latest v0.10.x release of node, do this:

nvm install 0.10

And then in any new shell just use the installed version:

nvm use 0.10

Or you can just run it:

nvm run 0.10 --version

Or, you can run any arbitrary command in a subshell with the desired version of node:

nvm exec 0.10 node --version

You can also get the path to the executable to where it was installed:

nvm which 0.10

In place of a version pointer like "0.10", you can use the special default aliases "stable" and "unstable":

nvm install stable
nvm install unstable
nvm use stable
nvm run unstable --version

If you want to install io.js:

nvm install iojs

If you want to use the system-installed version of node, you can use the special default alias "system":

nvm use system
nvm run system --version

If you want to see what versions are installed:

nvm ls

If you want to see what versions are available to install:

nvm ls-remote

To restore your PATH, you can deactivate it.

nvm deactivate

To set a default Node version to be used in any new shell, use the alias 'default':

nvm alias default stable

To use a mirror of the node binaries, set $NVM_NODEJS_ORG_MIRROR:

export NVM_NODEJS_ORG_MIRROR=https://nodejs.org/dist
nvm install 0.10

NVM_NODEJS_ORG_MIRROR=https://nodejs.org/dist nvm install 0.10

To use a mirror of the iojs binaries, set $NVM_IOJS_ORG_MIRROR:

export NVM_IOJS_ORG_MIRROR=https://iojs.org/dist
nvm install iojs-v1.0.3

NVM_IOJS_ORG_MIRROR=https://iojs.org/dist nvm install iojs-v1.0.3

nvm use will not, by default, create a "current" symlink. Set $NVM_SYMLINK_CURRENT to "true" to enable this behavior, which is sometimes useful for IDEs.



转载于:https://my.oschina.net/u/728294/blog/378307

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值