Skip to content

Commit

Permalink
Increase default timeout value from 30s to 5m
Browse files Browse the repository at this point in the history
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
  • Loading branch information
isaacs committed Apr 28, 2020
1 parent ebddbe7 commit fa211ab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ See also [`opts.ca`](#opts-ca).
##### <a name="opts-timeout"></a> `opts.timeout`

* Type: Milliseconds
* Default: 30000 (30 seconds)
* Default: 300000 (5 minutes)

Time before a hanging request times out.

Expand Down
2 changes: 1 addition & 1 deletion default-opts.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = {
maxSockets: 12,
method: 'GET',
registry: 'https://registry.npmjs.org/',
timeout: 30 * 1000,
timeout: 5 * 60 * 1000, // 5 minutes
strictSSL: true,
noProxy: process.env.NOPROXY,
userAgent: `${pkg.name
Expand Down

0 comments on commit fa211ab

Please sign in to comment.