question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Azure pipeline , error at npm install.

See original GitHub issue

Azure DevOps Type and Version

I have below script

- job: Windows
  pool:
    vmImage: 'vs2017-win2016'
  steps:
  - task: DotNetCoreInstaller@0
    inputs:
      packageType: 'sdk' 
      version: '2.2.100' 

  - task: NodeTool@0
    inputs:
      versionSpec: '10.15.0' 
      #checkLatest: false # Optional

  - script: 'dotnet clean $(backendDirName)/server.sln'
    displayName: Server - Clean

  - script: 'dotnet build $(backendDirName)/server.sln'
    displayName: Server - Build

  - script: 'dotnet test $(backendDirName)'
    displayName: Server - Test

  - script: 'npm --prefix ./$(frontDirName) install ./$(frontDirName)'
    displayName: Client - installation

  - script: 'npm run build --prefix $(frontDirName)'
    displayName: Client - Build 

What’s not working?

Please include error messages and screenshots.

I get error at point of Npm install !!!

The error is

2019-01-24T08:25:15.5876529Z npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
2019-01-24T08:25:15.5876999Z npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
2019-01-24T08:25:15.5878377Z 
2019-01-24T08:25:15.5913825Z npm ERR! code ELIFECYCLE
2019-01-24T08:25:15.5918430Z npm ERR! errno 1
2019-01-24T08:25:15.5921796Z npm ERR! ng-packagr@4.6.0 postinstall: `opencollective postinstall`
2019-01-24T08:25:15.5922341Z npm ERR! Exit status 1
2019-01-24T08:25:15.5923633Z npm ERR! 
2019-01-24T08:25:15.5923947Z npm ERR! Failed at the ng-packagr@4.6.0 postinstall script.
2019-01-24T08:25:15.5924162Z npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2019-01-24T08:25:15.6774873Z 
2019-01-24T08:25:15.6775578Z npm ERR! A complete log of this run can be found in:
2019-01-24T08:25:15.6775812Z npm ERR!     C:\npm\cache\_logs\2019-01-24T08_25_15_607Z-debug.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
TingluoHuangcommented, Jan 24, 2019

@arashbahreini add the following to your yaml file and queue another build

  - task: PublishBuildArtifacts@1
    displayName: Publish log
    condition: always()
    inputs:
      pathToPublish: "C:\npm\cache\_logs"
      artifactName: log
      artifactType: container
1reaction
TingluoHuangcommented, Jan 24, 2019

@arashbahreini i don’t think this is a problem with the agent itself, the agent run the script task and wait for STDOUT/STDERR/ExitCode. the task invoke npm.exe and base on npm’s return code to failed the step. you might want to add an always run step to upload log file from C:\npm\cache\_logs to debug this problem further.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Azure DevOps failing on "npm install" - Stack Overflow
Azure DevOps failing on "npm install" · Try running npm audit to see if it can find any issues. If it does, you...
Read more >
npm install fails in Azure DevOps Hosted Agent
From the last few days, our build pipelines have started to fail running the command “npm install”. It's even failing on previously successfull ......
Read more >
How to solve the error 'Npm failed with return code: 1' in Azure ...
The fix for the error was pretty simple. We just needed to go to our build pipeline, click on edit... Then we needed...
Read more >
Build pipeline failed with error 'Error: Npm failed with return code
I was trying to develop data factory pipeline using VSO deployments, I have configured my data factory to a 'Azure DevOps Git' repository ......
Read more >
Azure DevOps Pipeline NPM install task fails with node-gyp ...
I want to build an Azure Pipeline in Azure DevOps. When I run the pipeline an error is occurring in the npm build...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found