The build pipeline on on Azure DevOps is failing and it failed on the npm install task. When I do npm install locally, it builds successfully. What's even more weird is that for the most recent build fail on azure build pipeline, the code change does not include any javascript or typescript related code. The build definition did not get modified either.
Here's the error message:
{
"success": "false",
"error": "BadRequest",
"reason": "For security reasons, an upstream package cannot be downloaded from a browser. Please use an official Npm client.",
"innerException": null,
"message": "For security reasons, an upstream package cannot be downloaded from a browser. Please use an official Npm client.",
"typeName": "Microsoft.VisualStudio.Services.Packaging.Shared.WebApi.Exceptions.PotentiallyDangerousRequestException, Microsoft.VisualStudio.Services.Packaging.Shared.WebApi, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a",
"typeKey": "PotentiallyDangerousRequestException",
"errorCode": 0,
"eventId": 3000
}
npm WARN tar ENOENT: no such file or directory, open 'root\node_modules\.staging\moment-c2892a41\dist\locale\lo.js'
npm WARN tar ENOENT: no such file or directory, open 'root\node_modules\.staging\moment-c2892a41\locale\lo.js'
npm WARN tar ENOENT: no such file or directory, open 'root\node_modules\.staging\moment-c2892a41\src\locale\lo.js'
npm WARN tar ENOENT: no such file or directory, open 'root\node_modules\.staging\moment-c2892a41\src\lib\create\local.js'
npm WARN tar ENOENT: no such file or directory, open 'root\node_modules\.staging\moment-c2892a41\src\lib\locale\locale.js'
npm WARN tar ENOENT: no such file or directory, open 'root\node_modules\.staging\moment-c2892a41\src\lib\moment\locale.js'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN [email protected] requires a peer of @angular/common@>= 4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/core@>= 4.0.0 but none is installed. You must install peer dependencies yourself.
For the build pipeline, I am using Node 10.18.1. There's an npm authenticate .npmrc task before the npm install task.