When I run npm install
it seems to work fine until part way installing packages. It seems to have no problem with the first half, but then after a while it will fail to be able to reach other packages. I just get the repeating errors, eg:
npm http request GET https://registry.npmjs.org/react-hot-loader
npm info attempt registry request try #3 at 6:43:34 AM
npm http request GET https://registry.npmjs.org/react-tap-event-plugin
npm info attempt registry request try #3 at 6:43:34 AM
npm http request GET https://registry.npmjs.org/react-test-renderer
etc.
It will continue to do this for an hour and and then the install will fail.
The install breaks at a different package each time so I don't think it's a problem with a particular file.
I can access these files fine with my browser and curl
.
My work has a firewall but this domain is whitelisted.
Would anyone know what I could do to get this to work or what could be causing it?
How To Fix NPM Timeout Errors On Slow Internet Connections. The default value is 10 seconds, change it to 3600 seconds (1 hour) or more. npm config set cache-min 3600. Finally, run this command to check whether all the configuration changes are successfully applied or not.
Run npm update -g npm. Execute this command by running the command prompt as Administrator npm install -g windows-build-tools. Run npm install inside the project folder where the package. json file is located, if it doesn't work run: npm install --force.
If it's about the timing problem you should find a speed solutions for npm install.
So you can try these faster command than npm install :
pnpm install
%70 faster
ornpm install --no-audit
15% faster
ornpm install --prefer-offline --no-audit
15% faster
check this article for details : speeding up npm install
You can override the max and min timeout in ~/.npmrc
.
// npm config ls -l
// add these 2 lines in ~/.npmrc
fetch-retry-maxtimeout = 6000000
fetch-retry-mintimeout = 1000000
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With