Skip to content

request to https://registry.npm.taobao.org/@vueuse%2fcore failed, reason: certificate has expired

【问题】

在使用 npm 安装依赖时,出现了 certificate has expired 的错误。

bash
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@3. I'll try to do my best with it!
npm ERR! code CERT_HAS_EXPIRED
npm ERR! errno CERT_HAS_EXPIRED
npm ERR! request to https://registry.npm.taobao.org/@vueuse%2fcore failed, reason: certificate has expired

【解决】

在 2021 年,淘宝就发文称,npm 淘宝镜像已经从 registry.npm.taobao.org 切换到了 registry.npmmirror.com。旧域名也将于 2022 年 5 月 31 日停止服务。

查看当前的 npm 镜像库设置:

bash
npm config get registry

清空缓存:

bash
npm cache clean -f

设置新淘宝 npm 镜像库:

bash
npm config set registry https://registry.npmmirror.com

编程洪同学服务平台是一个广泛收集编程相关内容和资源,旨在满足编程爱好者和专业开发人员的需求的网站。无论您是初学者还是经验丰富的开发者,都可以在这里找到有用的信息和资料,我们将助您提升编程技能和知识。
专业开发
高端定制
售后无忧
站内资源均为本站制作或收集于互联网等平台,如有侵权,请第一时间联系本站,敬请谅解!本站资源仅限于学习与参考,严禁用于各种非法活动,否则后果自行负责,本站概不承担!