gpt4 book ai didi

javascript - 主机名/IP 与证书的别名不匹配

转载 作者:行者123 更新时间:2023-11-29 10:58:26 25 4
gpt4 key购买 nike

我正在处理一个 React Native 项目,任何从 npm 安装包的尝试都失败并出现以下错误。

fitz:tesseractOcrSample fitzmode$ npm i
npm ERR! request to https://registry.npmjs.org/react failed, reason: Hostname/IP doesn't match certificate's altnames: "Host: registry.npmjs.org. is not in the cert's altnames: DNS:a.sni.fastly.net, DNS:a.sni.global-ssl.fastly.net"

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/fitzmode/.npm/_logs/2018-09-01T13_08_53_778Z-debug.log

查看其他解决方案,我尝试在 npm config 中将 strict-ssl 设置为 false 无济于事。

我也尝试过使用 yarn 代替,但得到以下结果。

fitz:tesseractOcrSample fitzmode$ yarn install
yarn install v1.7.0
info No lockfile found.
[1/4] 🔍 Resolving packages...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
error An unexpected error occurred: "https://registry.yarnpkg.com/react: getaddrinfo ENOTFOUND registry.yarnpkg.com registry.yarnpkg.com:443".
info If you think this is a bug, please open a bug report with the information provided in "/Users/fitzmode/Downloads/react-native-tesseract-ocr-master/tesseractOcrSample/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

我不确定是我的网络配置错误还是其他原因。有什么解决办法吗?

最佳答案

这对我有用

我已经编辑了我的/etc/hosts 文件并创建了一个这样的条目

104.16.109.30   registry.npmjs.org

而且有效。

关于javascript - 主机名/IP 与证书的别名不匹配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52128460/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com