4

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?

David Mason
  • 915
  • 1
  • 9
  • 27

1 Answers1

2

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.

Ziyang Liu-MSFT
  • 469
  • 3
  • 6