0

I've installed react js in my pc. I tried to create a app in react in cmd by create-react-app react-app but it gave me following error:

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.
6
  • are u having good net connection? wats ur node and npm version? Commented May 10, 2020 at 18:36
  • It looks like the download of eslint took too long so the install script timed out. Have you tried installing a second time? Commented May 10, 2020 at 18:36
  • my node version is v12.16.3 and npm version is 6.14.4. And I also have a good net connection. I tried to install 4 or 5 times, same case! Commented May 10, 2020 at 18:39
  • Check if there is a firewall or VPN blocking the connection. Commented May 10, 2020 at 18:40
  • To debug try custom installing any package from NPM Repository to know if there is any problem connecting that domain. Commented May 10, 2020 at 18:42

2 Answers 2

1

It looks like your internet connection might be slow. Try increasing the timeout in your .npmrc

Sign up to request clarification or add additional context in comments.

4 Comments

i don't think so. my net connection is good. what did u say about .npmrc? I didn't understand
If you are on Windows, find the .npmrc file in C:\Program Files\nodejs\node_modules\npm change timeout=50000 Try create-react-app
i have found .npmrc file. But i can't open it. How do i solve this?
Open with Notepad? @AhnaafAlRafee
1

Try this, it might help

npm cache clean --force

2 Comments

share the error log, lets see if we find some detail in that to debug.
ps: you did try your npm install after this cache clean command. right?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.