【问题解决】npm ERR! code CERT_HAS_EXPIREDnpm ERR! errno CERT_HAS_EXPIREDnpm ERR! request to

        记录一次简单的报错,在执行npm install报错:

npm ERR! code CERT_HAS_EXPIRED
npm ERR! errno CERT_HAS_EXPIRED
npm ERR! request to https://registry.npm.taobao.org/yallist/download/yallist-2.1.2.tgz failed, reason: certificate has expired

npm ERR! A complete log of this run can be found in: D:\Program Files\nodejs\node_cache\_logs\2024-04-28T02_05_00_993Z-debug-0.log

如图:

 解决方式

1.手动设置npm镜像源

npm config set registry https://registry.npm.taobao.org/

2.清理npm缓存

npm cache clean --force

猜你喜欢

转载自blog.csdn.net/naihe_fish/article/details/138269461