简体   繁体   中英

Selfhosted Azure DevOps Agent running as NetworkService not able to complete npm install and npm build

The agent is not able to build and generate the build folder for react project while using the windows platform with Microsoft and self hosted agent but works fine with ubuntu.

This is the linux yml file with Microsoft agent

https://gist.github.com/yogeswaran-gnrgy/0354d455e6c85d387281eb75d1a326f1

This is the windows yml file with Microsoft agent

https://gist.github.com/yogeswaran-gnrgy/816b9f06dbe0039c07ad1293d2fce141

This is the log generated during the build step using Microsoft agent https://gist.github.com/yogeswaran-gnrgy/acbc3c2a268ea3b514cc423726b0a751

In case of Self-hosted agent it has both npm and node installed. What can be the problem

In Linux

- script: |
    echo Executing install
    npm install
    echo Executing build
    npm run build
  displayName: 'Building the project'

When used as script npm install and npm build works fine only in Linux. For windows, it must be like

- task: Npm@1
  displayName: 'Installing dependencies'
  inputs:
      verbose: false
      customCommand: install

- task: Npm@1
  displayName: 'Building the project'
  inputs:
      command: custom
      verbose: false
      customCommand: run build

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM