cli icon indicating copy to clipboard operation
cli copied to clipboard

[BUG] npm ERR! code ECONNRESET in jenkins pipeline with Node 16.13.1 and NPM 8.1.2

Open sandeepdussa opened this issue 3 years ago • 2 comments

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

We are facing below issue in our pipeline during npm install. But it works fine in our local machine.

00:45:05 npm timing reify:loadTrees Completed in 165792ms 00:45:05 npm timing reify:diffTrees Completed in 38ms 00:45:05 npm timing reify:retireShallow Completed in 1ms 00:45:06 npm timing reify:createSparse Completed in 428ms 00:45:06 npm timing reify:trashOmits Completed in 5ms 00:45:06 npm timing reify:loadBundles Completed in 0ms 00:45:53 npm verb stack Error: aborted 00:45:53 npm verb stack at connResetException (node:internal/errors:691:14) 00:45:53 npm verb stack at TLSSocket.socketCloseListener (node:_http_client:407:19) 00:45:53 npm verb stack at TLSSocket.emit (node:events:402:35) 00:45:53 npm verb stack at node:net:687:12 00:45:53 npm verb stack at Socket.done (node:_tls_wrap:580:7) 00:45:53 npm verb stack at Object.onceWrapper (node:events:510:26) 00:45:53 npm verb stack at Socket.emit (node:events:402:35) 00:45:53 npm verb stack at TCP. (node:net:687:12) 00:45:53 npm verb cwd /bld/workspace/er-pipeline_feature_node-upgrade 00:45:53 npm verb Linux 5.4.0-91-generic 00:45:53 npm verb argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--no-audit" "--no-optional" "--no-shrinkwrap" "--no-package-lock" "--loglevel" "verbose" 00:45:53 npm verb node v16.13.1 00:45:53 npm verb npm v8.1.2 00:45:53 npm ERR! code ECONNRESET 00:45:53 npm ERR! network aborted 00:45:53 npm ERR! network This is a problem related to network connectivity. 00:45:53 npm ERR! network In most cases you are behind a proxy or have bad network settings. 00:45:53 npm ERR! network 00:45:53 npm ERR! network If you are behind a proxy, please make sure that the 00:45:53 npm ERR! network 'proxy' config is set properly. See: 'npm help config' 00:45:53 npm verb exit 1 00:45:53 npm timing npm Completed in 206825ms

Expected Behavior

Smooth npm install is expected.

Steps To Reproduce

  1. In this environment... Jenkins
  2. With this config... Using internal artifactory
  3. Run '...' npm install "--no-audit" "--no-optional" "--no-shrinkwrap" "--no-package-lock" "--loglevel" "verbose"
  4. See error... error added in current behaviour

Environment

  • npm: 8.1.2
  • Node.js: 16.13.1
  • OS Name: Linux
  • System Model Name: Jenkins Pipeline

sandeepdussa avatar Jan 07 '22 16:01 sandeepdussa

@sandeepdussa, Implementing the following configurations solved my headache on npm verb stack Error: Socket timeout & npm verb stack Error: aborted for a similar scenario.

  • Although I believe that decreasing the maxsockets (default 15) did the trick, but also sharing the rest of the parameters that may be helpful:

maxsockets=10 fetch-retries=5 fetch-retry-factor=20 fetch-timeout=3600000 fetch-retry-mintimeout=3000000 fetch-retry-maxtimeout=3500000

vrej-abramian avatar Apr 28 '23 13:04 vrej-abramian

@sandeepdussa can you try replicating this problem on the latest version of npm? (ie. npm i -g npm)

milaninfy avatar Jun 27 '24 14:06 milaninfy

Closing due to age. If this is still a problem please feel free to reopen this issue, or create a new issue w/ steps to reproduce.

milaninfy avatar Jul 04 '24 14:07 milaninfy