berry: [Bug?]: No candidates found in corporate environment

Self-service

  • I’d be willing to implement a fix

Describe the bug

yarn install leads to

➤ YN0000: · Yarn 4.0.1
➤ YN0000: ┌ Resolution step
➤ YN0082: │ @typescript-eslint/scope-manager@npm:6.13.1: No candidates found
➤ YN0000: └ Completed in 9s 219ms
➤ YN0000: · Failed with errors in 9s 235ms

install with 1.22.19 works yarn config gives me

├─ npmRegistryServer
│  ├─ Description: URL of the selected npm registry (note: npm enterprise isn't supported)
│  ├─ Source: /home/myuser/code/myproject/.yarnrc.yml
│  └─ Value: 'https://artifactory.mycompany.net:443/artifactory/api/npm/npm'

yarn npm info @typescript-eslint/scope-manager gives me (excerpt)

{
    "name": "@typescript-eslint/scope-manager",
    "description": "TypeScript scope analyser for ESLint",
    "dist-tags": {
        ...
        "latest": "6.13.1",
        ...
    },
    "versions": [
        "3.5.0",
         ...
        "6.13.1",

    ],
    "time": {
        ...
        "6.13.1": "2023-11-28T09:36:31.088Z",
        ...
    },
    "dist": {
        "tarball": "https://artifactory.mycompany.net:443/artifactory/api/npm/npm/@typescript-eslint/scope-manager/-/scope-manager-6.13.1.tgz",
        "shasum": "58c7c37c6a957d3d9f59bc4f64c2888e0cac1d70",
        "integrity": "sha512-BW0kJ7ceiKi56GbT2KKzZzN+nDxzQK2DS6x0PiSMPjciPgd/JRQGMibyaN2cPt2cAvuoH0oNvn2fwonHI+4QUQ=="
    },
    "type": "commonjs"
}

To reproduce

I cannot provide, as this only occurs in my company repo I think

Environment

System:
    OS: Linux 5.15 Ubuntu 20.04.3 LTS (Focal Fossa)
    CPU: (12) x64 Intel(R) Core(TM) i7-9850H CPU @ 2.60GHz
  Binaries:
    Node: 20.10.0 - /tmp/xfs-d62f7f1e/node
    Yarn: 4.0.1 - /tmp/xfs-d62f7f1e/yarn
    npm: 10.2.3 - ~/.nvm/versions/node/v20.10.0/bin/npm

Additional context

No response

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 10
  • Comments: 19 (2 by maintainers)

Commits related to this issue

Most upvoted comments

I’m on 4.02, have the same symptom, and found the root cause (might be different than the original issue posted here). Yarn caches package metadata on disk, and it can get stale when there are newer versions of the package in the registry.

I have the following scenario: Package “x” has versions 1.0.0 and 1.1.0 in the registry. Yarn cached the metadata before 1.1.0 was released, therefore the metadata file cached has latest version 1.0.0 (stale). In my project I have 2 dependencies on package “x”, for both versions.

Yarn first resolves the request for 1.0.0, sees that it has cached metadata on disk that includes this version, and saves this metadata to an internal in-memory cache map. When yarn is resolving 1.1.0, it reads the list of versions directly from the in-memory cache and fails with “No candidates found”

I debugged the code and reached the above conclusion, although I might be wrong.

Deleting the metadata cache (for me it’s in ~/.yarn/berry/metadata/npm) works around this issue.

yarn cache clean --all && rm -rf ~/.yarn/berry/metadata fixed the issue for me

I am using version 4.4.1 and still have this issue

I see where that comes from, working on a fix.

@ohana54 I’ve looked into one case now in metadata

This version was failing to be installed

@esbuild/android-arm@0.19.10

and this is the cache of the registry for that package

{
  "metadata": {
    "dist-tags": {
      "latest": "0.19.8"
    },
    "versions": {
      "0.15.18": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.15.18.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.16.0": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.16.0.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.16.1": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.16.1.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.16.2": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.16.2.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.16.3": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.16.3.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.16.4": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.16.4.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.16.5": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.16.5.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.16.6": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.16.6.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.16.7": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.16.7.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.16.8": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.16.8.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.16.9": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.16.9.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.16.10": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.16.10.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.16.11": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.16.11.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.16.12": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.16.12.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.16.13": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.16.13.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.16.14": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.16.14.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.16.15": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.16.15.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.16.16": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.16.16.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.16.17": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.16.17.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.17.0": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.0.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.17.1": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.1.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.17.2": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.2.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.17.3": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.3.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.17.4": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.4.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.17.5": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.5.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.17.6": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.6.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.17.7": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.7.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.17.8": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.8.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.17.9": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.9.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.17.10": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.10.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.17.11": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.11.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.17.12": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.12.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.17.13": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.13.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.17.14": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.14.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.17.15": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.15.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.17.16": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.16.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.17.17": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.17.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.17.18": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.18.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.17.19": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.19.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.18.0": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.0.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.18.1": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.1.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.18.2": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.2.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.18.3": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.3.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.18.4": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.4.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.18.5": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.5.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.18.6": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.6.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.18.7": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.7.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.18.8": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.8.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.18.9": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.9.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.18.10": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.10.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.18.11": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.11.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.18.12": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.12.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.18.13": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.13.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.18.14": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.14.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.18.15": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.15.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.18.16": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.16.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.18.17": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.17.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.18.18": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.18.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.18.19": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.19.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.18.20": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.20.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.19.0": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.0.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.19.1": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.1.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.19.2": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.2.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.19.3": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.3.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.19.4": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.4.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.19.5": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.5.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.19.6": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.6.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.19.7": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.7.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      },
      "0.19.8": {
        "name": "@esbuild/android-x64",
        "dist": {
          "tarball": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.8.tgz"
        },
        "os": [
          "android"
        ],
        "cpu": [
          "x64"
        ]
      }
    }
  },
  "etag": "W/\"66be102acec06bd8e7b232b524334da9\"",
  "lastModified": "Sun, 26 Nov 2023 23:08:14 GMT"
}

It is indeed missing two versions that were released after the 26th Nov

image

The question is, why doesn’t Yarn look into the actual registry for a version that is not in the cached metadata, instead of taking that for a fact?

I’m also getting this error too often with yarn v4.0.x

➤ YN0082: │ @typescript-eslint/scope-manager@npm:6.13.2: No candidates found

I’m constantly getting the same errors with different transitive dependencies too and need to add them explicitly to get around this issue, using Yarn 4.0.2 - see https://stackoverflow.com/questions/77593499/why-does-yarn-fail-with-no-candidates-found-errors

yarn cache clean --all && rm -rf ~/.yarn/berry/metadata fixed the issue for me

To help any others who find this issue on Windows with corepack enabled, I found the metadata folder under: “%LOCALAPPDATA%\Yarn\Berry\metadata”

Using Git BASH for Windows, it’s possible to use this command to remove the directory… yarn cache clean --all && rm --recursive --force "$(yarn config get globalFolder)/metadata"

Yarn version 4.3.1 the issue still persist, only workaround is to delete the metadata folder. This issue should be reopened, since its the same error.

I use the GitLab private registry, and this issue still persists. Is anyone else experiencing a similar case?

Clearing the cache resolves the issue temporarily, but the same error occurs again the next time I update the package version, requiring me to clear the cache each time.

  System:
    OS: macOS 14.4.1
    CPU: (8) arm64 Apple M1
  Binaries:
    Node: 20.9.0 - /private/var/folders/gk/l64q570d7tdf5gxlwr36nnq00000gn/T/xfs-fd789e8e/node
    Yarn: 4.1.1 - /private/var/folders/gk/l64q570d7tdf5gxlwr36nnq00000gn/T/xfs-fd789e8e/yarn
    npm: 10.1.0 - ~/.nvm/versions/node/v20.9.0/bin/npm```

With @ericis answer I was able to resolve the issue. yarn config get globalFolder revealed that in my case yarn used ~/.local/share/yarn/berry/metadata/. So for linux users: yarn cache clean --all && rm -rf $(yarn config get globalFolder)/metadata

Find it very weird that clearing cache won’t fix the issue either:

k ~/development/design-3 [1085-typescript-eslint-typescript-estree-warning] $ yarn cache clean         
➤ YN0000: Done in 0s 1ms
k ~/development/design-3 [1085-typescript-eslint-typescript-estree-warning] $ yarn install    
➤ YN0000: · Yarn 4.0.2
➤ YN0000: ┌ Project validation
➤ YN0057: │ @neo4j-ndl/react: Resolutions field will be ignored
➤ YN0057: │ @neo4j-ndl/storybook: Resolutions field will be ignored
➤ YN0000: └ Completed
➤ YN0000: ┌ Resolution step
➤ YN0082: │ @storybook/core-common@npm:7.6.10: No candidates found
➤ YN0000: └ Completed in 2s 177ms
➤ YN0000: · Failed with errors in 2s 195ms