Ubuntu16.04安装最新版nodejs

匿名 (未验证) 提交于 2019-12-03 00:22:01
更新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
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!