Closed ganemone closed 6 years ago
This might be related to https://github.com/npm/npm/issues/7862
What about the current .get
timeout config parameter?
client.get(uri, params, cb)
...
timeout {Number} Duration before the request times out. Optional (default: never).
I'm closing this because npm-registry-client
is no longer used as the fetcher for npm5. pacote
and make-fetch-happen
should both support a timeout option now, though I can't recall if it's fully threaded through or hard-defaulted on the npm side of things.
Thanks for the contribution! It's been a while now but I'm glad to be dealing with these old PRs :)
Since the request library does not set a default timeout, any request that hangs will hang indefinitely and cause
npm install
to hang indefinitely. The request library recommends having a timeout on all requests. This diff adds a timeout option that defaults to 10 seconds, as well as tests surrounding the timeout functionality.