Nodejs 安裝

1. Ubuntu下安裝node

sudo apt-get install python-software-properties
sudo apt-get install nodejs nodejs-legacy
sudo apt-get install npm
npm install --save n

// n 的使用
sudo n latest
sudo n stable
sudo n lts

// npm 升級
sudo npm install npm@latest -g

2. 若是在Ubuntu 下安裝出現 404時python

sudo apt-get clean
sudo apt-get update

3. 修改鏡像express

// 臨時使用
npm --registry https://registry.npm.taobao.org install express

// 永久使用
npm config set registry https://registry.npm.taobao.org

// 經過 cnpm  使用
npm install -g cnpm --registry=https://registry.npm.taobao.org
相關文章
相關標籤/搜索