ubuntu上安裝並使用nvm管理node版本

nvm是一個很是不錯的node版本管理器,相似於ruby的rvm。node

其github地址爲https://github.com/creationix/nvmgit

此處介紹一下如何在ubuntu上安裝使用nvm。github

首先安裝必要的包。

view plain copyubuntu

sudo apt-get update  api

sudo apt-get install build-essential libssl-dev  ruby

而後安裝nvm的腳本,有兩種方法curl或wget:

經過curl:bash

 view plain copycurl

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.4/install.sh | bash  ui

經過wget:url

view plain copy

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

檢查安裝及使用:

注意,此處須要重啓terminal終端才能生效。

使用nvm --help查看是否安裝成功。

使用nvm ls查看已經安裝的版本。

使用nvm ls-remote查看全部遠端版本。

使用nvm install安裝某個版本,如nvm install v5.3.0。

使用nvm use切換到某個版本,如nvm use v5.3.0使用5.3.0,nvm use system使用系統版本。

參考:http://blog.csdn.net/shidaping/article/details/52218278

相關文章
相關標籤/搜索