您的位置:首页 > Web前端 > Node.js

ubuntu上安装并使用nvm管理node版本

2017-05-11 00:00 866 查看
nvm是一个非常不错的node版本管理器,类似于ruby的rvm。

其github地址为https://github.com/creationix/nvm

此处介绍一下如何在ubuntu上安装使用nvm。

首先安装必要的包。

view plain copy

sudo apt-get update

sudo apt-get install build-essential libssl-dev

然后安装nvm的脚本,有两种方法curl或wget:

通过curl:

view plain copy

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

通过wget:

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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: