Azure-pipelines-tasks: NPM failing to install packages

Created on 27 May 2018  路  8Comments  路  Source: microsoft/azure-pipelines-tasks

Environment

  • Server - VSTS or TFS on-premises?

Using VSTS :

  • Account Name : able-android
  • Team Project Name: AblePortalFunctions
  • Definition name: Node.CI-No-Pack
  • Build Number: 461
  • Agent - Hosted or Private:
    Hosted

Issue Description

NPM started failing to download npm packages.

Note that no changes has been done to the packages.json file. It suddenly started failing since yesterday.

Error logs

2018-05-27T08:52:07.2002451Z 34315 error Windows_NT 6.3.9600
2018-05-27T08:52:07.2002582Z 34316 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
2018-05-27T08:52:07.2002710Z 34317 error node v6.9.1
2018-05-27T08:52:07.2002797Z 34318 error npm  v3.10.8
2018-05-27T08:52:07.2002885Z 34319 error code ETIMEDOUT
2018-05-27T08:52:07.2002974Z 34320 error errno ETIMEDOUT
2018-05-27T08:52:07.2003068Z 34321 error syscall connect
2018-05-27T08:52:07.2003168Z 34322 error network connect ETIMEDOUT 104.18.94.96:443
2018-05-27T08:52:07.2003338Z 34323 error network This is most likely not a problem with npm itself
2018-05-27T08:52:07.2003609Z 34323 error network and is related to network connectivity.
2018-05-27T08:52:07.2003723Z 34323 error network In most cases you are behind a proxy or have bad network settings.
2018-05-27T08:52:07.2003817Z 34323 error network
2018-05-27T08:52:07.2003910Z 34323 error network If you are behind a proxy, please make sure that the
2018-05-27T08:52:07.2004022Z 34323 error network 'proxy' config is set properly.  See: 'npm help config'
2018-05-27T08:52:07.2004116Z 34324 verbose exit [ 1, true ]
2018-05-27T08:52:07.2004172Z 
2018-05-27T08:52:07.2057172Z ##[error]Error: Npm failed with return code: 1

Most helpful comment

I don't believe this issue is resolved. It appears that if the network has a hiccup then NPM will abort. Trying again is a workaround which may or may not work all the time.

Is there a retry setting or timeout condition that can be set?

All 8 comments

external npm registry service was down for maintenance. is it still persisting?

I've just tried it again and it seems to be working. Closing this issue for now. Thanks!

I don't believe this issue is resolved. It appears that if the network has a hiccup then NPM will abort. Trying again is a workaround which may or may not work all the time.

Is there a retry setting or timeout condition that can be set?

NPM registry is up and running. I can "npm install" locally from here just fine. But on VSTS that step fails with the same network error message.
Seems there's a connection issue from VSTS to npm - correct me if I;m wrong...

We've got the very same issue, npm install runs perfectly in local, but times out on different resources in VSTS. Queuing a new build normally resolves it, but we've been doing that for about 4-5 times this morning to no avail.
Can we set no timeout on npm install or increase the wait time before it shuts down?

Locally, you are protected by a cache. Hosted machines are a clean machine every build. If you setup a private agent on an azure VM you will get caching like you do locally. The timeout is coming from npm service via the npm cli.

Thanks @bryanmacfarlane. Would we need to leverage this below in order to extend the timeout?
https://docs.npmjs.com/misc/config#fetch-retry-maxtimeout

@army-watchfinder - not sure but it's worth a try. You could try it with command line task and supply your own args or use a script before to set in config.

Was this page helpful?
0 / 5 - 0 ratings