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

相关文章
相关标签/搜索