作为NetworkService运行的自托管Azure DevOps代理无法完成npm安装和npm构建



在使用带有Microsoft和自托管代理的windows平台时,代理无法为react项目构建和生成构建文件夹,但在使用ubuntu时效果良好。

这是带有Microsoft代理的linux yml文件

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

这是带有微软代理的windows yml文件

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

这是使用Microsoft代理在生成步骤中生成的日志https://gist.github.com/yogeswaran-gnrgy/acbc3c2a268ea3b514cc423726b0a751

在自托管代理的情况下,它同时安装了npm和节点。有什么问题

在Linux 中

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

当用作脚本时,npm安装和npm构建仅在Linux中工作良好。对于windows,它必须像一样

- 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

最新更新