sh-3.2# npm install
npm ERR! code CERT_HAS_EXPIRED
npm ERR! errno CERT_HAS_EXPIRED
npm ERR! request to https://registry.npm.taobao.org/yauzl/download/yauzl-2.10.0.tgz failed, reason: certificate has expired
npm ERR! A complete log of this run can be found in: /var/root/.npm/_logs/2024-04-25T02_04_01_904Z-debug-0.log
遇到 npm ERR! code CERT_HAS_EXPIRED 错误时,尝试从淘宝的npm镜像(registry.npm.taobao.org)下载包时,由于SSL/TLS证书问题而失败了
npm config set strict-ssl false
禁用 strict-ssl 可能允许继续使用该镜像
将 npm 的 strict-ssl 配置项设置为 false 会使 npm 在与仓库通信时忽略 SSL 证书错误
附上镜像源
npm config set registry https://registry.npmjs.org/
npm config set registry https://registry.npmmirror.com