简体   繁体   English

创建反应应用程序时出错

[英]getting an error while creating react application

hello public Am getting an error while creating an react application don't know what's going on wrong please try to fix my error hello public 创建 React 应用程序时出现错误不知道发生了什么问题,请尝试修复我的错误

and also tell me what should i do?并告诉我我该怎么办?

note :: my internet connection is good注意 :: 我的互联网连接良好

my updated latest node and other packages https://ibb.co/tmyyB4M我更新的最新节点和其他软件包https://ibb.co/tmyyB4M

F:\React JS>npx create-react-app project

Creating a new React app in F:\React JS\project.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...

yarn add v1.22.10
info There appears to be trouble with your network connection. Retrying...
[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...
error An unexpected error occurred: "https://registry.yarnpkg.com/react: tunneling socket could not be established, cause=connect ECONNREFUSED 127.0.0.1:80".
info If you think this is a bug, please open a bug report with the information provided in "F:\\React JS\\project\\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 F:\React JS\project has failed.

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

This happens in case your internet connection is too slow, one way of fixing it if your are using Yarn is by increasing Yarn network timeout,如果您的互联网连接速度太慢,则会发生这种情况,如果您使用 Yarn,则一种修复方法是增加 Yarn 网络超时,

Refrence : https://github.com/yarnpkg/yarn/issues/4890#issuecomment-358179301参考: https : //github.com/yarnpkg/yarn/issues/4890#issuecomment-358179301

Do The following!请执行下列操作!

npm uninstall -g create-react-app
npm uninstall -g yarn
npm cache clean --force
npm install -g create-react-app
create-react-app your-project-name

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

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