在安装依赖的时候,有时npmi会很慢,甚至不成功,错误等,其中一个原因是使用直接npm国外源和国内访问国外源网站肯定很慢,所以下面的测试是比较国外镜像源和国内阿里巴巴淘宝源的速度。镜像下载、域名解析、时间同步请点击阿里巴巴开源镜像站:https://developer.aliyun.com/...首先使用国外镜像源npmconfigsetregistryhttps://registry.npmjs.org查看是否替换npmconfiggetregistry安装依赖测试速度npmi如图耗时8秒左右替换阿里巴巴开源镜像站-OPSX镜像站中的淘宝NPM镜像npmconfigsetregistryhttps://registry.npmmirror.com去查是否替换npmconfiggetregistry安装和依赖npmi如图用了5秒左右,比国外源镜像快多了。对了,淘宝npm镜像站换了新域名,新网址:https://npmirror。com,注册表端点:https://registry.npmmirror.com。由于新域名已经正式上线,旧http://npm.taobao.org和http://registry.npm.taobao.org域名将于2022年5月31日0:00停止服务,请使用这个npmbeforeconfigsetregistryhttps://registry.npm.taobao.org记得改源到npmconfigsetregistryhttps://registry.npmirror.com
