1.臨時使用
npm --registry https://registry.npm.taobao.org install express
2.持久使用
npm config set registry https://registry.npm.taobao.org
再執行一個這個
npm config set disturl https://npm.taobao.org/dist --global
配置后可通過下面方式來驗證是否成功
npm config get registry
3.通過cnpm使用
npm install -g cnpm --registry=https://registry.npm.taobao.org
使用
cnpm install express