2015年4月20日 星期一

安裝 NVM 來管理你的 Nodejs

webber0928

安裝 NVM 來管理你的 Nodejs

此安裝法適用於ubuntu
鳩咪

Install script

要安裝使用 curl install script:
$ curl https://raw.github.com/creationix/nvm/v0.4.0/install.sh | sh
或是 Wget:
$ wget -qO- https://raw.github.com/creationix/nvm/v0.4.0/install.sh | sh
檔案會存在 ~/.nvm
然後請新增以下命令列到 .bashrc 的最後面:
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.nvm/bin" ] ; then
  export PATH="$HOME/.nvm/bin:$PATH"
  export NVM_DIR="$HOME/.nvm"
fi
[ -s "$HOME/.nvm/nvm.sh" ] && . "$HOME/.nvm/nvm.sh"

Usage

下載打包好的套件:
$ nvm install v0.10.26
或自行編譯:
$ nvm install -s v0.10.26
設置node默認版本,請使用default
$ nvm alias default v0.10.26
切換使用的node版本
$ nvm use v0.11.12
or
$ nvm use default
運行指令檢查所有node版本:
$ nvm ls
運行指令檢查本機安裝的node版本:
$ nvm ls-remote

參考網址

By webber0928

一個小菜鳥工程師,對籃球還有夢想的男孩。

0 意見:

張貼留言

Coprights @ 2016, Blogger Templates Designed By Templateism | Distributed By Gooyaabi Templates