Ubuntu16.04安装最新版nodejs

来源:互联网 发布:网站编辑seo是什么 编辑:程序博客网 时间:2024/06/06 00:05
更新ubuntu软件源
sudo apt-get updatesudo apt-get install -y python-software-properties software-properties-commonsudo add-apt-repository ppa:chris-lea/node.jssudo apt-get update
安装nodejs
sudo apt-get install nodejssudo apt install nodejs-legacysudo apt install npm
更新npm的包镜像源,方便快速下载
sudo npm config set registry https://registry.npm.taobao.orgsudo npm config list
全局安装n管理器(用于管理nodejs版本)
sudo npm install n -g
安装最新的nodejs(stable版本)
sudo n stablesudo node -v


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