Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to increase waiting timeout from 30000 ms to 60000 ms of npm installing time in ubuntu

Since my internet connection is slow, i couldn't install packages from npm because of the fact that the npm returns with error as

npm ERR! Response timeout while trying to fetch https://registry.npmjs.org/create-react-app (over 30000ms)

i hoped if i increase the waiting time to one minute or more the error will likely be fixed. And since i am on ubuntu 18.04 i couldn't figure out a way to do this.

like image 876
Lioul Avatar asked May 08 '20 18:05

Lioul


People also ask

How do I increase timeout in npm?

fetch-retry-maxtimeout This config controls the maximum time (in milliseconds) npm wait before timing out when fetching packages from the registry. The default value is 10000 milliseconds (10 seconds), change it to 600000 or more.

How long does npm update take?

it takes ~5 minutes to download and install.

What to do if npm install hangs?

To solve the issue, try removing the entire node_modules/ folder and the package-lock. json file. Then try running the npm install command again. That may fix the issue.


2 Answers

I don't know how similar to your problem. But I had trouble executing the following command after executing npm install -g npm-check-updates:

ncu -u

I just kept increasing the timeout after the command until it was fully executed.

ncu -u --timeout 100000
like image 160
Alexis Flores Avatar answered Sep 23 '22 02:09

Alexis Flores


add this to your .npmrc file:

timeout=60000
like image 45
Ron Avatar answered Sep 22 '22 02:09

Ron