Azure管道:脚本的输出在哪里?

发布于 2025-02-02 19:25:38 字数 871 浏览 5 评论 0原文

我试图在自托管代理上构建我的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文件夹或Dister dist内部文件夹。

但也没有控制台输出。

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

“在此处输入图像描述”

我如何获取更多日志来找出为什么角CLI无法正确安装?我看到在代理商上执行的“脚本”文件默认情况下在脚本前面放下@echo。
为什么?
我如何获得一些输出来找到我的问题?

I tried to build my Angular 13 app on a self-hosted agent and created the following YAML snippet for this:

- 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'     

I can observe the /s directory of the agent _work-directory and after my task was running, there is no node_modules folder or dist folder inside.

But also no console output.

If I remove the line "npm install -g @angular/cli" from the line, a node_modules folder gets created, but no dist-folder.
I am pretty sure that the installation of angular cli fails, but I do not get any error output in my window.
It just looks like this:

enter image description here

How can I get more logs to find out why the angular cli is not installing correctly? I saw that the "script" file that is executed on the agent puts an @echo off by default in front of the script.
Why is that?
How can I get some output to find my problem?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

べ映画 2025-02-09 19:25:38

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

对于YAML管道,您可以在YAML编辑页面右上角选择变量。

添加一个名称system.debug和dualue true的新变量。

有关日志的更多信息,请参阅审查日志以诊断管道问题

To get more detailed log from the pipeline you can add the variable system.debug and set the value to true in your pipeline.

For YAML pipelines, you can select Variables in the upper right corner of the YAML edit page.

enter image description here

Add a new variable with the name System.Debug and value true.

enter image description here

For more info about logs, please refer to Review logs to diagnose pipeline issues.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文