首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在执行npx创建-react app时获取以下错误

在执行npx创建-react app时获取以下错误
EN

Stack Overflow用户
提问于 2021-03-06 09:01:08
回答 1查看 810关注 0票数 0

我试过重新安装纱线,npm

尝试了npm缓存干净纱线缓存干净

在npx创建-react app my-app时,仍然面临同样的问题。

代码语言:javascript
复制
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...

yarn add v1.22.4
[1/4] Resolving packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/react: self signed certificate in certificate chain".
info If you think this is a bug, please open a bug report with the information provided in "C:\\Users\\suryanarayan.rath\\DMS-cloud\\resilient-app\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

Aborting installation.
  yarnpkg add --exact react react-dom react-scripts cra-template --cwd C:\Users\suryanarayan.rath\DMS-cloud\resilient-app has failed.

Deleting generated file... package.json
Deleting generated file... yarn.lock
Done.

在纱线-错误日志中,它显示如下

代码语言:javascript
复制
Error: self signed certificate in certificate chain
      at TLSSocket.onConnectSecure (_tls_wrap.js:1502:34)
      at TLSSocket.emit (events.js:314:20)
      at TLSSocket._finishInit (_tls_wrap.js:937:8)
      at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:711:12)

我看到了许多类似的问题,但没有找到正确的解决办法。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-03-06 12:01:21

我能够通过

代码语言:javascript
复制
yarn config set "strict-ssl" false -g

代码语言:javascript
复制
npm config set "strict-ssl" false -g

将严格的-ssl设置为false解决了我的问题。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66504015

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档