繁体   English   中英

如何解决在 React js 中创建应用程序时出错

[英]How to solve error creating app in react js

我已经在我的电脑中安装了 react js。 我试图通过create-react-app react-app在 cmd 中创建一个反应应用程序,但它给了我以下错误:

C:\Users\Ahnaaf Al Rafee>create-react-app react-app

Creating a new React app in C:\Users\Ahnaaf Al Rafee\react-app.

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

npm ERR! Response timeout while trying to fetch https://registry.npmjs.org/@typescript-eslint%2fparser (over 30000ms)

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Ahnaaf Al Rafee\AppData\Roaming\npm-cache\_logs\2020-05-10T18_28_37_892Z-debug.log

Aborting installation.
  npm install --save --save-exact --loglevel error react react-dom react-scripts has failed.

Deleting generated file... package.json
Deleting react-app / from C:\Users\Ahnaaf Al Rafee
Done.

看起来您的互联网连接可能很慢。 尝试增加.npmrc中的超时时间

试试这个,它可能会有所帮助

npm cache clean --force

暂无
暂无

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

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