nrm 是一个 能够查看可以切换npm源(仓库)工具
最近遇到了npm 无法下载包的问题,科学上网工具Pac和全局模式都无法解决,所以换个源试一试,结果成功了.
npm ERR! Unexpected end of JSON input while parsing near '...publish_time":1404163'
1. 安装
npm i nrm -g
2. 使用
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/
nrm use taobao
3. 验证
npm config get registry
https://registry.npm.taobao.org/
网友评论