记录一次简单的报错,在执行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