getting 'API resource location is not registered' error with Azure pipeline cache task

Viewed 1011

I'm trying to cache my npm dependencies using the Cache task in Azure Pipelines. I'm using Azure DevOps Server 2020. When the pipeline runs I get the following error message:

Resolving key:
 - npm                          [string]
 - "Windows_NT"                 [string]
 - Web/package-lock.json [file] --> 118CDFE1CFD866ABF2489C955D015ED5D2962A76602B6B544D996C46B84
Resolved to: npm|"Windows_NT"|1C9oHznmI3rlvpEvjwhi+Ssx/V05b9WttZRq
Resolving restore key:
 - npm          [string]
 - "Windows_NT" [string]
Resolved to: npm|"Windows_NT"|**
Information, Getting a pipeline cache artifact with the following fingerprint: `npm|"Windows_NT"|1C9oHznmI3rlvpEvjwhi+Ssx/V05b9WttZRqxHYD+2w=`.
##[error]API resource location a7c78d38-31a8-417e-ba6b-7e58b352f304 is not registered on https://[azure_devops_url]/DefaultCollection/.

Here is part of my pipeline YAML:

variables:
    npm_config_cache: $(Pipeline.Workspace)/Web/.npm
steps:
  - task: NodeTool@0
    displayName: 'Use Node 14.15.0'
    inputs:
      versionSpec: 14.15.0
      checkLatest: false
  - task: Cache@2
    displayName: 'Cache NPM packages'
    inputs:
      key: 'npm | "$(Agent.OS)" | Web/package-lock.json'
      restoreKeys: |
        npm | "$(Agent.OS)"
      path: $(npm_config_cache)
  - script: npm ci

I install my npm packages in a subfolder. How do I solve the error?

2 Answers

It looks that this is not supported on premises. Please check this GitHub issue.

Related