Talk is cheap, show me the code.
环境 | Environment
| k | version |
|---|---|
| OS | windows 11 |
| node | v18.14.2 |
| npm | 9.5.0 |
报错日志 | Error log
>npm create vite@latest
Need to install the following packages:
create-vite@5.0.0
Ok to proceed? (y) y
npm ERR! code UNABLE_TO_GET_ISSUER_CERT_LOCALLY
npm ERR! errno UNABLE_TO_GET_ISSUER_CERT_LOCALLY
npm ERR! request to https://cdn.npmmirror.com/packages/create-vite/5.0.0/create-vite-5.0.0.tgz failed, reason: unable to get local issuer certificate
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\tanpenggood\AppData\Local\npm-cache\_logs\2023-11-22T02_46_11_530Z-debug-0.log
解决方案 | Solution
在 npm 项目中,发现类似的 [ISSUE #14667],并在 issue 的最后找到了解决方案。
npm config set strict-ssl false
参考 | References
优快云 - 安装npm包的时候出现unable to get local issuer certificate的错误解决办法
https://github.com/npm/npm/issues/14667
https://docs.npmjs.com/misc/config
相关问题 | Related
优快云 - git 报错SSL certificate problem: unable to get local issuer certificate解决办法
git config http.sslverify false
用户在Windows11环境下使用npm创建Vite时遇到SSL证书错误。问题与npm#14667相似,解决方案是设置`npmconfigsetstrict-sslfalse`。相关问题还提及了Git的SSL验证问题及其解决方法。
573

被折叠的 条评论
为什么被折叠?



