How to fix the issue: ##[error]Error: No package found with specified pattern:...

Discussão em 'Angular' iniciado por Creanix Developer, Março 28, 2025.

  1. I have a pipeline for building and deploying an angular app. It builds successfully but fails during deployment with the error: ##[error]Error:

    No package found with specified pattern: /home/vsts/work/1/s/**/*.zip
    Check if the package mentioned in the task is published as an artifact in the build or a previous stage and downloaded in the current job.

    I added debug script to see the pipeline workspace and i can see the zip file in the drop folder as it was meant to be. But in the debug stage, it is not referencing that location and i get the error i stated above.

    `/home/vsts/work/1:
    TestResults
    a
    b
    drop
    s

    /home/vsts/work/1/TestResults:

    /home/vsts/work/1/a:

    /home/vsts/work/1/b:

    /home/vsts/work/1/drop:
    249.zip

    /home/vsts/work/1/s:`


    My pipeline is below:

    `trigger:
    - main

    resources:
    - repo: self

    variables:
    azureSubscription: 'VMS ARM SC NRG'
    webAppName: 'vms-dev-webclient'
    vmImageName: 'ubuntu-latest'
    dev-url: https://vms-dev-webclientt.azurewebsites.net

    stages:
    - stage: Build
    displayName: Build Angular App
    jobs:
    - job: Build
    displayName: Build Angular App
    pool:
    vmImage: $(vmImageName)

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

    - script: npm install
    displayName: Install npm packages

    - script: npm run build --if-present
    displayName: Build Angular project

    - task: ArchiveFiles@2
    displayName: 'Archive Build Output'
    inputs:
    rootFolderOrFile: '$(System.DefaultWorkingDirectory)/dist'
    includeRootFolder: false
    archiveType: zip
    archiveFile: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip
    replaceExistingArchive: true

    - publish: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip
    artifact: drop
    displayName: Publish Build Artifact

    - stage: Deploy_Development
    displayName: Deploy to Development
    dependsOn: Build
    condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
    jobs:
    - deployment: Deploy
    displayName: Deploy to Development
    environment: Development
    pool:
    vmImage: $(vmImageName)
    strategy:
    runOnce:
    deploy:
    steps:
    - task: DownloadPipelineArtifact@2
    displayName: 'Download Build Artifacts'
    inputs:
    artifactName: 'drop'
    downloadPath: '$(Pipeline.Workspace)/drop'

    - script: ls -R $(Pipeline.Workspace)
    displayName: 'Debug: List Pipeline Workspace'

    - task: AzureWebApp@1
    displayName: 'Deploy to Development'
    inputs:
    azureSubscription: $(azureSubscription)
    appName: $(webAppName)
    #packageForLinux: '$(Pipeline.Workspace)/drop/$(Build.BuildId).zip'
    packageForLinux: '/home/vsts/work/1/drop/$(Build.BuildId).zip'
    deploymentMethod: 'zipDeploy'
    startUpCommand: 'pm2 serve /home/site/wwwroot/dist/vms-project-web --spa --no-daemon'

    - task: CmdLine@2
    displayName: Confirm Deployment
    inputs:
    script: 'curl -sSf $(dev-url) > /dev/null'
    failOnStderr: true`


    I need any help I can get.

    I tried hard coding the path: packageForLinux: '/home/vsts/work/1/drop/$(Build.BuildId).zip' and its still the same error.

    Continue reading...

Compartilhe esta Página