cli
cli copied to clipboard
[BUG] npm install fails with ECONNRESET when metainfo is big
Is there an existing issue for this?
- [X] I have searched the existing issues
This issue exists in the latest npm version
- [X] I am using the latest npm
Current Behavior
If package metainfo, for some reasons, is superbig (e.g. 70 mb), npm install often fails with ECONNRESET. Argument --prefer-offline does not help.
yarn works just fine, 5 out of 5 times it ends with success. npm fails 5 out of 5.
Also, yarn 1 finished after 1-2 mins, without yarn.lock file (repo itself uses npm, so there is no yarn.lock and there is package-lock.json), and npm fails after 15-20 mins.
Expected Behavior
Same as yarn 1 – dont fail if there are problems with metainfo. Im not sure why yarn 1 is better here, but could make guess: 1) it retries failed requests many times 2) it does not request metainfo.
Steps To Reproduce
- just repo with deps, which has superbig metainfo (e.g. webpack, playwright or @typescript-eslint/eslint-plugin) and not very good network
-
- Run 'npm install'
- see
npm i --prefer-offline
npm WARN deprecated @***/[email protected]: Not usefull anymore in webpack 5 with its own filesystem cache
npm WARN deprecated [email protected]: no longer supported
npm ERR! code ECONNRESET
npm ERR! errno ECONNRESET
npm ERR! network Invalid response body while trying to fetch https://***/repository/npm-all/@typescript-eslint%2feslint-plugin: aborted
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/d***/.npm/_logs/2022-07-13T12_41_34_019Z-debug-0.log
Environment
- npm: 8.11.0
- Node.js: 16.v16.15.1
- OS Name: mac OS Monterey 12.4
- System Model Name: -
- npm config:
; "user" config from /Users/d***/.npmrc
//npm-rnd.***/:_authToken = (protected)
//registry.npmjs.org/:_authToken = (protected)
always-auth = true
email = "d***@***"
init-author-email = "d***@***"
init-author-name = "D K"
; registry = "https://***/repository/npm-all/" ; overridden by project
; "project" config from /Users/d***/Projects/***-forms/.npmrc
_auth = (protected)
ca = [""]
engine-strict = true
legacy-peer-deps = true
registry = "https://***/repository/npm-all/"
strict-ssl = false
; node bin location = /Users/d***/.nvm/versions/node/v16.15.1/bin/node
; node version = v16.15.1
; npm local prefix = /Users/d***/Projects/***-forms
; npm version = 8.11.0
; cwd = /Users/d***/Projects/***-forms
; HOME = /Users/d***
; Run `npm config ls -l` to show all defaults.
you say "with not a very good network", can you estimate the actual bandwidth you have available?
do you also see this problem when using registry.npmjs.org instead of your custom registry?
Sure! The actual bandwidth (traffic speed measured with iStat Menu during npm install) is something about 150KB/s. Probably this is the company's registry limitation, because speedtest gives me >10MB/s.
do you also see this problem when using registry.npmjs.org instead of your custom registry?
I cant use it because of many private packages.
We wanted to migrate from yarn 1 to npm 8, but current issue is blocker-level problem for us ((