nodejsバージョン管理ツール:Node Version Manager

2597 ワード

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、comple、and install the latest v 0.1.x release of node、do this:
nvm install 0.10
And then in any new shell juse the installed version:
nvm use 0.10
Or you can just run it:
nvm run 0.10 --version
Or,you can run any arbitrry 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-innstalled 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.