Reputation: 51
When I try to run this, I get this error:
npm ERR! Response timeout while trying to fetch https://registry.npmjs.org/@typescript-eslint%2fparser (over 30000ms)
This is what happens in the log:
205 warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
206 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS: darwin
206 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch: any
206 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS: win32
206 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
207 verbose type body-timeout
208 verbose stack FetchError: Response timeout while trying to fetch https://registry.npmjs.org/@typescript-eslint%2fparser (over 30000ms)
208 verbose stack at Timeout._onTimeout (C:\Program Files\nodejs\node_modules\npm\node_modules\node-fetch-npm\src\body.js:189:16)
208 verbose stack at listOnTimeout (internal/timers.js:549:17)
208 verbose stack at processTimers (internal/timers.js:492:7)
209 verbose cwd C:\Users\Acc\mern-todo-app
210 verbose Windows_NT 10.0.18362
211 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--save" "--save-exact" "--loglevel" "error" "react" "react-dom" "react-scripts" "cra-template"
212 verbose node v12.16.2
213 verbose npm v6.14.4
214 error Response timeout while trying to fetch https://registry.npmjs.org/@typescript-eslint%2fparser (over 30000ms)
215 verbose exit [ 1, true ]
I'm pretty new to this so I have no idea what's happening.
Upvotes: 5
Views: 15923
Reputation: 387
For me, it was because of my antivirus(node32) and after I paused RealTime Protection the problem went away.
Upvotes: 0
Reputation: 1
I also encountered the timeout problem while trying to install react app by using
npx create-react-app app-name
The solution is to uninstall node, then go to node js official site to download a new one, then install and try
npx create-react-app my-app
It will work perfectly.
Upvotes: 0
Reputation: 1045
Maybe, someone has my case. In my case the error was reporting a line like this: npm install --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.
I just installed those packages one-by-one, by typing:
npm install --save --save-exact --loglevel error react
npm install --save --save-exact --loglevel error react-dom
npm install --save --save-exact --loglevel error react-scripts
npm install --save --save-exact --loglevel error cra-template
After that, I just run npx create-react-app appname
and it worked
Upvotes: 3
Reputation: 1
I also faced similar error while creating react app for the first time after installing NodeJS. It was not solved by running below commands in sequence:
npm cache clean --force
npm install create-react-app
npx create-react-app my-app
I also faced this issue again again, I tried with this code by adding timeout into 12000000 and it worked like a charm.
Upvotes: 0
Reputation: 1
If you run it on Windows, try to open shell windiw as an admin, had the same error and it helped me.
Upvotes: 0
Reputation: 3809
I wasn't able to solve it using clear cache, delete proxy etc. So, I tried yarn and it worked like a charm!
yarn create react-app project-name
Upvotes: 0
Reputation: 41
I also faced similar issue and was able to fix the issue with following commands:
npx clear-npx-cache
npx create-react-app my-app
Upvotes: 3
Reputation: 1
I'm getting this issue after giving lots of command its and working and while creating app after few seconds lots of errors found If you are behind a proxy, please make sure that the network 'proxy' config is set properly. See: 'npm help config'
Upvotes: -3
Reputation: 60
Use -timeout flag npm create react app -timeout=1000
. Note => timeout flag take tge value in mili second
Upvotes: 0
Reputation: 363
I also faced this issue, I tried with this code by adding timeout into it and it worked like a charm.
npx create-react-app my-app -timeout=60000
Here 60000 is 60 seconds. You can increase the time as per your choice.
Upvotes: 14
Reputation: 93
I also faced similar error while creating react app for the first time after installing NodeJS. It was resolved by running below commands in sequence:
npm cache clean --force
npm install create-react-app
npx create-react-app my-app
Upvotes: 2
Reputation: 104
Try clearing cache and rerun the command. $ npm cache clean --force
Upvotes: 3