Azure-pipelines-tasks: windows-latest build agent not executing first command only

Created on 25 Sep 2019  路  3Comments  路  Source: microsoft/azure-pipelines-tasks

Required Information

Entering this information will route you directly to the right team and expedite traction.

Question, Bug, or Feature?
Type: Bug/Question

Enter Task Name: script

list here (V# not needed):
https://github.com/Microsoft/azure-pipelines-tasks/tree/master/Tasks

Environment

  • Server - Azure Pipelines

    • can provide the account name, team project name, build definition name/build number via direct message or email.
  • Agent - Hosted:

    • agent queue name: windows-latest(?)

Issue Description

When installing node dependencies in windows-latest hosted agent for a react app, the second command in the script task below (npm run build) is not being executed but the task successfully completes, creating an error for the next task (ArchiveFiles trying to zip a folder that doesn't exist).

trigger:
- develop

pool:
  vmImage: 'windows-latest'

steps:
- task: NodeTool@0
  inputs:
    versionSpec: '10.6'
  displayName: 'Install Node.js'

- script: |
    npm install
    npm run build
  displayName: 'npm install and build'

If the agent is changed to ubuntu-latest the script executes both npm install and npm build.

The issue could be that there is something throwing an error in the node install process, but nothing is logged. Is there any way to get better logs from this task to help troubleshoot?

Task logs

2019-09-25T08:58:58.5451576Z npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\jest-haste-map\node_modules\fsevents):
2019-09-25T08:58:58.5452235Z npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
2019-09-25T08:58:58.5453013Z npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\chokidar\node_modules\fsevents):
2019-09-25T08:58:58.5453309Z npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
2019-09-25T08:58:58.5453966Z npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
2019-09-25T08:58:58.5454258Z npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
2019-09-25T08:58:58.5455707Z 
2019-09-25T08:58:58.5514640Z added 1502 packages from 761 contributors and audited 902649 packages in 64.752s
2019-09-25T08:58:58.6314352Z ##[section]Finishing: npm install
2019-09-25T08:58:58.6332853Z ##[section]Starting: list files
2019-09-25T08:58:58.6464364Z ==============================================================================
2019-09-25T08:58:58.6464424Z Task         : Command line
2019-09-25T08:58:58.6464483Z Description  : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows
2019-09-25T08:58:58.6464516Z Version      : 2.151.2
2019-09-25T08:58:58.6464548Z Author       : Microsoft Corporation
2019-09-25T08:58:58.6464612Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/command-line
2019-09-25T08:58:58.6464646Z ==============================================================================
2019-09-25T08:58:59.7258495Z Generating script.
2019-09-25T08:58:59.7380346Z Script contents:
2019-09-25T08:58:59.7389016Z dir .
2019-09-25T08:58:59.7774707Z ========================== Starting Command Output ===========================
2019-09-25T08:58:59.8098937Z ##[command]"C:\windows\system32\cmd.exe" /D /E:ON /V:OFF /S /C "CALL "d:\a\_temp\b988dafc-5def-4fa6-8b1b-4175b9b12c5d.cmd""
2019-09-25T08:58:59.8253172Z  Volume in drive D is Temporary Storage
2019-09-25T08:58:59.8253592Z  Volume Serial Number is 8EA2-89A7
2019-09-25T08:58:59.8253748Z 
2019-09-25T08:58:59.8253947Z  Directory of D:\a\1\s
2019-09-25T08:58:59.8254108Z 
2019-09-25T08:58:59.8254581Z 09/25/2019  08:58 AM    <DIR>          .
2019-09-25T08:58:59.8255551Z 09/25/2019  08:58 AM    <DIR>          ..
2019-09-25T08:58:59.8255804Z 09/25/2019  08:57 AM                18 .eslintignore
2019-09-25T08:58:59.8256187Z 09/25/2019  08:57 AM             2,116 .eslintrc.json
2019-09-25T08:58:59.8256617Z 09/25/2019  08:57 AM               333 .gitignore
2019-09-25T08:58:59.8256981Z 09/25/2019  08:57 AM               937 azure-pipelines.yml
2019-09-25T08:58:59.8257630Z 09/25/2019  08:58 AM    <DIR>          node_modules
2019-09-25T08:58:59.8257906Z 09/25/2019  08:57 AM           553,018 package-lock.json
2019-09-25T08:58:59.8258312Z 09/25/2019  08:57 AM             1,251 package.json
2019-09-25T08:58:59.8258715Z 09/25/2019  08:57 AM    <DIR>          public
2019-09-25T08:58:59.8259116Z 09/25/2019  08:57 AM             2,949 README.md
2019-09-25T08:58:59.8259840Z 09/25/2019  08:57 AM    <DIR>          src
2019-09-25T08:58:59.8260069Z 09/25/2019  08:57 AM           473,370 yarn.lock
2019-09-25T08:58:59.8281976Z                9 File(s)      1,035,142 bytes
2019-09-25T08:58:59.8282134Z                5 Dir(s)  12,650,405,888 bytes free
2019-09-25T08:58:59.8599686Z ##[section]Finishing: list files
2019-09-25T08:58:59.8617015Z ##[section]Starting: ArchiveFiles
2019-09-25T08:58:59.8756398Z ==============================================================================
2019-09-25T08:58:59.8756447Z Task         : Archive files
2019-09-25T08:58:59.8756568Z Description  : Compress files into .7z, .tar.gz, or .zip
2019-09-25T08:58:59.8756605Z Version      : 2.151.2
2019-09-25T08:58:59.8756637Z Author       : Microsoft Corporation
2019-09-25T08:58:59.8756669Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/archive-files
2019-09-25T08:58:59.8756723Z ==============================================================================
2019-09-25T08:59:00.1872828Z ls: no such file or directory: d:\a\1\s\build
2019-09-25T08:59:00.1873141Z 
2019-09-25T08:59:00.1930346Z Error: ENOENT: no such file or directory, stat 'd:\a\1\s\build'
2019-09-25T08:59:00.2022087Z ##[error]ENOENT: no such file or directory, stat 'd:\a\1\s\build'
2019-09-25T08:59:00.2048186Z ##[section]Finishing: ArchiveFiles
2019-09-25T08:59:00.2074907Z ##[section]Starting: Checkout
2019-09-25T08:59:00.2202067Z ==============================================================================
2019-09-25T08:59:00.2202120Z Task         : Get sources
2019-09-25T08:59:00.2202173Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2019-09-25T08:59:00.2202228Z Version      : 1.0.0
2019-09-25T08:59:00.2202263Z Author       : Microsoft
2019-09-25T08:59:00.2202295Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2019-09-25T08:59:00.2202348Z ==============================================================================
2019-09-25T08:59:00.7188992Z Cleaning any cached credential from repository: co2-investigation (Git)
2019-09-25T08:59:00.7275101Z ##[section]Finishing: Checkout
2019-09-25T08:59:00.7348409Z ##[section]Starting: Finalize Job
2019-09-25T08:59:00.7516606Z Start cleaning up orphan processes.
2019-09-25T08:59:00.7532597Z ##[section]Finishing: Finalize Job
2019-09-25T08:59:00.7592547Z ##[section]Finishing: Job
Core bug question

All 3 comments

Hey @Robjam - I'm not able to reproduce - are you still experiencing this issue? Could you provide an example build by chance?

Closing due to inactivity - feel free to comment if you'd like me to reopen

I am having the same problem.

Was this page helpful?
0 / 5 - 0 ratings