Ubuntu16.04安装最新版nodejs

更新ubuntu软件源

sudo apt-get update
sudo apt-get install -y python-software-properties software-properties-common
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update

安装nodejs

sudo apt-get install nodejs
sudo apt install nodejs-legacy
sudo apt install npm

更新npm的包镜像源,方便快速下载

sudo npm config set registry https://registry.npm.taobao.org
sudo npm config list

全局安装n管理器(用于管理nodejs版本)

sudo npm install n -g

安装最新的nodejs(stable版本)

sudo n stable
sudo node -v



作者:十戒s
链接:http://www.jianshu.com/p/2b24cd430a7d
來源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

猜你喜欢

转载自my.oschina.net/u/3648322/blog/1800635