一、淘宝镜像:
临时使用:
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
三、使用nrm — NPM registry 管理工具
安装
npm install -g nrm
使用 ``` bogon:bilibili cuiliang$ nrm ls
npm ———— https://registry.npmjs.org/ yarn ———- https://registry.yarnpkg.com/
- cnpm ———- http://r.cnpmjs.org/ taobao ——- https://registry.npm.taobao.org/ nj ————- https://registry.nodejitsu.com/ npmMirror — https://skimdb.npmjs.com/registry/ edunpm ——- http://registry.enpmjs.org/
bogon:bilibili cuiliang$ nrm use taobao
Registry has been set to: https://registry.npm.taobao.org/
bogon:bilibili cuiliang$ nrm ls
npm ———— https://registry.npmjs.org/ yarn ———- https://registry.yarnpkg.com/ cnpm ———- http://r.cnpmjs.org/
- taobao ——- https://registry.npm.taobao.org/ nj ————- https://registry.nodejitsu.com/ npmMirror — https://skimdb.npmjs.com/registry/ edunpm ——- http://registry.enpmjs.org/ ```