Open okirpane opened 2 years ago
it's likely what's happening here is a request is timing out, so we're retrying it. by default we'll retry the same package 2 times after the initial failure, so i would expect to see what appears to be npm hanging for the time it takes 3 requests to timeout which is ~15 minutes by default. if you npm i --fetch-timeout=60000
it'll reduce the overall failure time to ~3 minutes, though based on the information provided all that's really going to do is get you to an error quicker.
i'm curious, how large of a package are you seeing this failure with? if you download the package tarball outside of npm (i.e. curl
or wget
) how long does it take to transfer?
this is extremely annoying. Happened to me in train again yesterday 2 retries as default is not enough. Sometimes you're offline on train for 5 minutes or more The default retries should be like 10 or so Also, large packages should be fetched in chunks and the chunks should be retried individually
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
When I run
npm i
on my computer (Macbook Pro 2020) with a 5G internet connection that drops packages every now and then, the command hangs at larger packages. Basically:npm i
CTRL+C
in the terminal to quit the process and find a more consistent network connection.Expected Behavior
I would expect my package manager to at least work when my connection wavers a little. The fact that NPM just fails completely is dissapointing.
Steps To Reproduce
npm i
Environment
prefix = "/opt/homebrew"
; "project" config from /Users/okirp/Desktop/ojasvin/.npmrc
engine-strict = true
; node bin location = /opt/homebrew/Cellar/node/16.11.0/bin/node ; cwd = /Users/okirp/Desktop/ojasvin ; HOME = /Users/okirp ; Run
npm config ls -l
to show all defaults.