ubuntu16.04 安裝node.js

1、更新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
2、安裝nodejs
sudo apt-get install nodejs
sudo apt install nodejs-legacy
sudo apt install npm
3、更新npm的包鏡像源,方便快速下載
sudo npm config set registry https://registry.npm.taobao.org
sudo npm config list
4、全局安裝n管理器(用於管理nodejs版本)
sudo npm install n -g
5、安裝最新的nodejs(stable版本)
sudo n stable
6、升級npm爲最新版本
sudo npm install npm@latest -g
7、查看版本
sudo node -v
sudo npm -v
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章