如何解决React JS中的错误创建应用程序

时间:2020-05-10 18:33:59

标签: javascript reactjs create-react-app

我已经在我的电脑上安装了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.

2 个答案:

答案 0 :(得分:1)

看来您的互联网连接速度很慢。尝试增加.npmrc

中的超时

答案 1 :(得分:1)

尝试一下,可能有帮助

npm cache clean --force