请使用nrm,不推荐使用 cnpm

为了加快安装依赖的安装速度,有些猿可能会装 cnpm,但是这样会导致包的依赖安装不正常,项目无法运行。

更好的做法是使用 nrm 切换下载源。

安装 nrm

  npm i -g nrm 

查看下载镜像源

  nrm ls

输出如下

npm ---- https://registry.npmjs.org/
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

添加源

nrm add 别名

然后就可以享用这些快速镜像了,赶快去试试吧

转载自哪?忘记了....鸣谢作者

posted @ 2020-01-13 16:57  wpt80  阅读(435)  评论(0编辑  收藏  举报