繁体   English   中英

为什么我无法获得 https://registry.yarnpkg.com 的本地颁发者证书

[英]Why I got unable to get local issuer certificate for https://registry.yarnpkg.com

运行yarn add <anything>时,我碰巧遇到错误unable to get local issuer certificate

昨天它工作得很好,但今天它突然发生了,我不记得具体做了什么。

运行yarn config set strict-ssl false后它会再次工作,但这是非常可疑的。

我知道我的问题似乎是重复的,但事实并非如此。 我一直在到处搜索,但它们似乎适用于某些情况,例如在公司代理后面运行或设置新服务器。 我不支持任何代理。

你能帮我看看我应该在哪里进一步调查以了解真正的根本原因。

我使用的是 macOS Monterey 12.0.1

完整日志

z:~/work/littlepawcraft/mawsay[main !?]$ yarn add html2canvas --verbose
yarn add v1.22.19
verbose 0.185927225 Checking for configuration file "/Users/z/work/littlepawcraft/mawsay/.npmrc".
verbose 0.186249071 Checking for configuration file "/Users/z/.npmrc".
verbose 0.186511794 Found configuration file "/Users/z/.npmrc".
verbose 0.187669087 Checking for configuration file "/usr/local/etc/npmrc".
verbose 0.188048555 Checking for configuration file "/Users/z/work/littlepawcraft/mawsay/.npmrc".
verbose 0.188284222 Checking for configuration file "/Users/z/work/littlepawcraft/.npmrc".
verbose 0.188639829 Checking for configuration file "/Users/z/work/.npmrc".
verbose 0.188928153 Checking for configuration file "/Users/z/.npmrc".
verbose 0.189152548 Found configuration file "/Users/z/.npmrc".
verbose 0.189640273 Checking for configuration file "/Users/.npmrc".
verbose 0.191425842 Checking for configuration file "/Users/z/work/littlepawcraft/mawsay/.yarnrc".
verbose 0.191663753 Checking for configuration file "/Users/z/.yarnrc".
verbose 0.191811016 Found configuration file "/Users/z/.yarnrc".
verbose 0.192157101 Checking for configuration file "/usr/local/etc/yarnrc".
verbose 0.192324062 Checking for configuration file "/Users/z/work/littlepawcraft/mawsay/.yarnrc".
verbose 0.192446487 Checking for configuration file "/Users/z/work/littlepawcraft/.yarnrc".
verbose 0.192626013 Checking for configuration file "/Users/z/work/.yarnrc".
verbose 0.192732424 Checking for configuration file "/Users/z/.yarnrc".
verbose 0.192809809 Found configuration file "/Users/z/.yarnrc".
verbose 0.192994673 Checking for configuration file "/Users/.yarnrc".
verbose 0.196011087 current time: 2022-06-29T01:58:26.170Z
[1/4] 🔍  Resolving packages...
verbose 0.464574716 Performing "GET" request to "https://registry.yarnpkg.com/html2canvas".
verbose 0.619253995 Error: unable to get local issuer certificate
    at TLSSocket.onConnectSecure (node:_tls_wrap:1530:34)
    at TLSSocket.emit (node:events:390:28)
    at TLSSocket._finishInit (node:_tls_wrap:944:8)
    at TLSWrap.ssl.onhandshakedone (node:_tls_wrap:725:12)
error An unexpected error occurred: "https://registry.yarnpkg.com/html2canvas: unable to get local issuer certificate".
info If you think this is a bug, please open a bug report with the information provided in "/Users/z/work/littlepawcraft/mawsay/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

  1. 检查您的 .npmrc 是否未指定手动 CA。
  2. 检查您是否支持公司代理。
  3. 检查您的本地证书是否已损坏。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM