gpt4 book ai didi

azure-devops - Azure 管道 : Where is the output of my script?

转载 作者:行者123 更新时间:2023-12-05 05:40:26 26 4
gpt4 key购买 nike

我尝试在自托管代理上构建我的 Angular 13 应用程序并为此创建了以下 YAML 代码段:

- task: NodeTool@0
displayName: 'Install Node.js'
inputs:
versionSpec: '14.x'
- script: |
npm install -g @angular/cli
npm install
ng build --configuration production --aot
displayName: 'npm install and build'
workingDirectory: '$(Build.SourcesDirectory)/src'

我可以观察agent_work-directory的/s目录,我的任务运行后,里面没有node_modules文件夹和dist文件夹。

但也没有控制台输出。

如果我从该行中删除“npm install -g @angular/cli”行,则会创建一个 node_modules 文件夹,但不会创建 dist-folder。
我很确定 angular cli 的安装失败了,但是我的窗口中没有得到任何错误输出。它看起来像这样:

enter image description here

如何获取更多日志以找出 angular cli 未正确安装的原因?我看到在代理上执行的“脚本”文件在脚本前面默认关闭了@echo。
这是为什么?
我怎样才能得到一些输出来找到我的问题?

最佳答案

要从管道中获取更详细的日志,您可以添加变量 system.debug 并将值设置为管道中的 true

对于YAML流水线,可以在YAML编辑页面的右上角选择Variables。

enter image description here

添加一个名为 System.Debug 且值为 true 的新变量。

enter image description here

关于日志的更多信息,请引用Review logs to diagnose pipeline issues .

关于azure-devops - Azure 管道 : Where is the output of my script?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72433737/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com