报错信息: npm ERR! errno CERT_HAS_EXPIRED
D:\Apps\nodejs-v18.16.1\npx.cmd --yes create-next-app"@latest" . --ts
npm ERR! code CERT_HAS_EXPIRED
npm ERR! errno CERT_HAS_EXPIRED
npm ERR! request to https://registry.npm.taobao.org/create-next-app failed, reason: certificate has expired
npm ERR! A complete log of this run can be found in:
npm ERR! D:\Apps\nodejs-v18.16.1\node_cache\_logs\2024-01-22T10_27_35_078Z-debug-0.log
Done
信息描述
npm 请求 taobao镜像仓库时报错, 原因: 证书过期
原因
淘宝镜像源过期了, 需要更换镜像源, 具体看阿里云官网说明
阿里云NPM镜像仓库更新说明
解决方案
# 更新镜像源
npm config set registry http://registry.npmmirror.com
# 清理npm缓存
npm cache clean --force