美文网首页
在ubuntu上安装最新稳定版本的node及npm

在ubuntu上安装最新稳定版本的node及npm

作者: 萤火虫de梦 | 来源:发表于2017-09-12 15:14 被阅读155次
sudo apt install nodejs-legacy
sudo apt install npm

1、安装npm

sudo apt install npm

2、升级npm为最新版本

sudo npm install npm@latest -g

此时通过npm -v可以发现npm版本号为最新版本3.10.3;

3、安装用于安装nodejs的模块n

sudo npm install -g n

4、然后通过n模块安装指定版本的nodejs,n模块更多介绍请参考官方文档

//安装官方最新版本
sudo n latest
//安装官方稳定版本
sudo n stable
//安装官方最新LTS版本
sudo n lts

相关文章

网友评论

      本文标题:在ubuntu上安装最新稳定版本的node及npm

      本文链接:https://www.haomeiwen.com/subject/memcsxtx.html