原始源
// the original source
https://registry.npmjs.org/
使用 nrm 去管理npm镜像
安装
npm install -g nrm
查看可用的源
nrm ls
会输出
* npm -------- https://registry.npmjs.org/
yarn ------- https://registry.yarnpkg.com/
cnpm ------- http://r.cnpmjs.org/
taobao ----- https://registry.npmmirror.com/
nj --------- https://registry.nodejitsu.com/
npmMirror -- https://skimdb.npmjs.com/registry/
edunpm ----- http://registry.enpmjs.org/
切换
// 比如切换到淘宝
nrm use taobao
测试速度
nrm test
改变全局的注册
设置默认源
npm config set registry https://registry.npmmirror.com/
查看结果
npm config get registry
测试
npm info underscore
npm清理缓存
npm cache clean --force
查看npm缓存的位置
npm cache dir
// or
npm config list --json
忽略npm的版本报错
npm install --force