![](/img/trans.png)
[英]Getting 'A task is missing. The pipeline references a task called 'Cache'.' error in Azure Pipeline
[英]Unable to run Azure pipeline "A task is missing. The pipeline references a task called 'Cache'
我正在使用 azure_pipeline.yaml 配置設置 Github 項目的分支。 這似乎對社區中的其他人都很好,但是當我設置管道時,它給了我以下異常:
A task is missing. The pipeline references a task called 'Cache'. This usually indicates the task isn't installed, and you may be able to install it from the Marketplace: https://marketplace.visualstudio.com. (Task version 2, job 'compile_ci_build', step ''.)
A task is missing. The pipeline references a task called 'Cache'. This usually indicates the task isn't installed, and you may be able to install it from the Marketplace: https://marketplace.visualstudio.com. (Task version 2, job 'test_ci_build', step ''.)
A task is missing. The pipeline references a task called 'Cache'. This usually indicates the task isn't installed, and you may be able to install it from the Marketplace: https://marketplace.visualstudio.com. (Task version 2, job 'e2e_ci_build', step ''.)
具體來說,
這是我的Azure 管道鏈接
azure-pipeline.yml
tools/azure-pipelines/jobs-template.yml
參數化的tools/azure-pipelines/jobs-template.yml
[更新]
我修改了jobs-templates.yml並用Cache@2
注釋掉了所有步驟,它運行良好。
按照設計,當你運行管道時,Azure DevOps 不會自動使所有任務可用。
您必須手動添加它們作為管道的一部分。
“緩存”就是這樣一項任務。
我在經典 gui(非 yaml)模式下執行此操作,因為我發現搜索內容更容易但是您所做的是在管道中添加一個新任務並在任務搜索框中鍵入“緩存”。
這將調出任務。 單擊添加以將其包含在管道中。
有關這方面的更多信息,我建議閱讀:
https://docs.microsoft.com/en-us/azure/devops/pipelines/release/caching?view=azure-devops
最終能夠使這個工作。
顯然是我的 Azure 帳戶。 我不允許使用Cache@2
。 更改所有行
- task: Cache@2
到
- task: CacheBeta@1
解決了我所有的問題。
我沒有看到您從 git 存儲庫中在管道中添加了緩存任務。
它應該看起來像這里的例子:
variables:
YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn
steps:
- task: Cache@2
inputs:
key: 'yarn | "$(Agent.OS)" | yarn.lock'
restoreKeys: |
yarn | "$(Agent.OS)"
yarn
path: $(YARN_CACHE_FOLDER)
displayName: Cache Yarn packages
- script: yarn --frozen-lockfile
我遇到了同樣的錯誤A task is missing. The pipeline references a..
A task is missing. The pipeline references a..
在PublishCucumberReport@1
一項 azure 任務中A task is missing. The pipeline references a..
我通過訪問https://marketplace.visualstudio.com/
並轉到任務然后單擊get free
按鈕來解決它,該按鈕將其安裝在您的管道上
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.