6
votes

We have a build running a "NPM install" task in Azure DevOps (VSTS).

Error from the log:

2018-11-30T11:13:20.3544084Z ##[debug]Agent.BuildDirectory=D:\a\1
2018-11-30T11:13:20.3544294Z ##[debug]rm -rf D:\a\1\npm
2018-11-30T11:13:20.3544390Z ##[debug]removing directory
2018-11-30T11:13:20.3544478Z ##[debug]task result: Failed
2018-11-30T11:13:20.3597315Z ##[error]Error: Npm failed with return code: 1
2018-11-30T11:13:20.3606909Z ##[debug]Processed: ##vso[task.issue type=error;]Error: Npm failed with return code: 1
2018-11-30T11:13:20.3608689Z ##[debug]Processed: ##vso[task.complete result=Failed;]Error: Npm failed with return code: 1

It seems it is unable to delete the folder "D:\a\1\npm"

Even the builds who used to be successful are now consistently failing (last successful build was 2018-11-27). We are running on Agent Pool "Hosted VS2017".

Are anybody else experiencing something similar in Azure DevOps/VSTS?

EDIT: The yml for the step:

steps:
- task: Npm@1
  displayName: 'npm install'
  inputs:
    workingDir: web/
    verbose: true

Picture of pipeline in Azure DevOps

EDIT 2: It also fails when the "NPM Install" is ran as the first task in the Buils:

2018-11-30T14:13:49.0617793Z ##[debug]Agent.BuildDirectory=D:\a\1
2018-11-30T14:13:49.0617936Z ##[debug]rm -rf D:\a\1\npm
2018-11-30T14:13:49.0618038Z ##[debug]removing directory
2018-11-30T14:13:49.0618144Z ##[debug]task result: Failed
2018-11-30T14:13:49.0671864Z ##[error]Error: Npm failed with return code: 1
2
we are using hosted ubuntu and it works for us4c74356b41
I don't have any issues with the Hosted VS2017 agent and npm install on a Angular 6 project. Can you try running the build on a different agent?Martin Brandl
why should npm attempt to remove D:\a\1\npm when your code is synced to D:\a\1\s? can you share the configuration of the task running "npm install" ?D.J.
Updated question with some more details @D.J.Markus Foss
@MarkusFoss, I started an experiencing npm failing in our CI builds as well but I determined it was missing dependency package. Looking at the log files you submitted, it doesn't seem like that's what it is but it probably wouldn't hurt to check.Ryan Hill

2 Answers

0
votes

This may not be related to Azure DevOps trying to execute rm -rf D:\a\1\npm.

Do you have any npm error messages? When this has failed for us, our error message was:

2018-11-27T07:10:16.3177900Z 8080 error code ELIFECYCLE
2018-11-27T07:10:16.3177998Z 8081 error errno 1
2018-11-27T07:10:16.3178126Z 8082 error [email protected] install: `node-pre-gyp install --fallback-to-build --library=static_library`
2018-11-27T07:10:16.3178257Z 8082 error Exit status 1
2018-11-27T07:10:16.3178367Z 8083 error Failed at the [email protected] install script.
0
votes

It turned out to be a transitive dependancy on npm package event-stream 3.3.6. This is removed from npm, and therefor the build no longer was succesfull. The solution was to downgrade the package, and lock the version.

Thanks for your input, ppl!