-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[QUESTION] Is there a way to define timeout for npm install
#1151
Comments
Also worth mentioning: |
Seems to be used in make-fetch-happen which is used in npm-registry-fetch and pacote. We're running into an issue where the metadata has gotten big enough to push us over 30 seconds in some environments. There still doesn't seem to be a way to configure the magic |
Same here I post it on ionic cli github |
downgrading to 6.13.x resolved it for me - ea0ff56#diff-3c78131ed196efbd3ce9fdee2df36e24R79 |
@darcyclarke for now, we get more problems because of that, cause latest Node.js v12.16.2 was shipped with NPM v6.14.x by default. Seems like upgrading Without the ability to redefine timeout for that And seems like it is a bug, cause before that changes ea0ff56#diff-acf38193ec0e2d9a3b9dc202f239a77aR12, huge meta-files was not a problem at all. |
@sidoruk-sv appreciate you bringing this to our attention. I'm going to take this back internally & see if we can ship a patch to resolve this &/or find/introduce a flag. |
We are unable to deploy our project, most often webpack meta file does timeout, sometimes firebase. It got worse the last weeks, seems the meta file now reached a point were it is consistantly failing. We will try to downgrade to 6.13.7. Edit: after downgrading we got the first green build after 10+ fails, looks promising. |
Re: #26 Re: npm/cli#1151 The documented default timeout of 30s was not being set in v4, so we "fixed the glitch" in v4.0.3, causing problems for people trying to download large packages. There's no npm v6 way to specify what timeout to use, so not having a timeout at all seems like a reasonable default for the v4 line, at least. Let's roll back that change, and document it. (Arguably, fixing this bug was a breaking change, and we ought to roll it back.) This effectively reverts 69c2977, with documentation of the effective behavior before the change.
Re: #26 Re: npm/cli#1151 The previous default of 30s was too small for lots of users, causing problems when they attempt to download large objects from the npm registry. Bump up the default timeout to 5m. TODO: add a `--fetch-timeout` option on the CLI to explicitly set `timeout` in the npm.flatOptions object passed to all dependencies.
Let's move the default timeout back to zero for nrf v4 (npm v6), bump it up to 5m in latest (npm v7), and add a I think that'd solve the immediate issue and put us in a better spot going forward. |
Re: #26 Re: npm/cli#1151 The documented default timeout of 30s was not being set in v4, so we "fixed the glitch" in v4.0.3, causing problems for people trying to download large packages. There's no npm v6 way to specify what timeout to use, so not having a timeout at all seems like a reasonable default for the v4 line, at least. Let's roll back that change, and document it. (Arguably, fixing this bug was a breaking change, and we ought to roll it back.) This effectively reverts 69c2977, with documentation of the effective behavior before the change. PR-URL: #27 Credit: @isaacs Close: #27 Reviewed-by: @isaacs
Re: #26 Re: npm/cli#1151 The previous default of 30s was too small for lots of users, causing problems when they attempt to download large objects from the npm registry. Bump up the default timeout to 5m. TODO: add a `--fetch-timeout` option on the CLI to explicitly set `timeout` in the npm.flatOptions object passed to all dependencies. PR-URL: #28 Credit: @isaacs Close: #28 Reviewed-by: @isaacs
So the current fix is to upgrade to NPM It would be perfect when latest Node.js versions (10.x, 12.x, 13.x, 14.x) to be shipped with |
the npm config documentation has several entries for timeouts. Is this code ignoring those settings, or is there no setting for this specific case and that's the issue? |
|
What / Why
For now, we have a problem with the package, which meta info file (where all versions are listed) weights more than 110Mb and it takes 2.5 minutes to download the file on my machine, for our team it causes annoying npm install failed because of
Where
For now, on the local environment, I had to tune npm files, to change the default timeout.
In NPM debug log I found that
Response timeout...
message comes from~/.nvm/versions/node/v12.16.1/lib/node_modules/npm/node_modules/node-fetch-npm/src/body.js:189:16
This one sources: https://github.com/npm/node-fetch-npm/blob/latest/src/body.js#L189
I hardcoded that in such a way:
Who
n/a
References
n/a
So the question is:
Is there some parameter/ENV_VARIABLE, that can be passed or be defined before
npm install
command, which will overridethis.timeout
value in the code that I share.The text was updated successfully, but these errors were encountered: