Repository navigation
Please don't make error of fetching latest version information if packageManager field is specified. #625
Description
Activity
Global impact.
As a workaround env var COREPACK_INTEGRITY_KEYS=0 helpsReacted by maksimkirylkaReacted by Sanghin, Frédéric Espiau, Anthony Whitford, Matthias Fechner, Kalle Ahlström, Greyfeather, Jay Willmot, Espen Jacobsson, Adrian Kunz, Gabriele Tomberli and 2 moreThis issue is not mainly about unable to use newer version of pnpm (and other package managers), about inaccessibility with fresh corepack installation for projects has
packageManagerfield.And this issue is to prevent future similar problems, not current problem.
Current problem was fixed in #614 and other issues are there.For reference, here is workarounds for current problem depending on your use case.
If you can, upgrading corepack to latest can solve this problem.
If this is not suitable for you, you can do:
- For new version inaccessibility (like pnpm@10), we can use
COREPACK_INTEGRITY_KEYS={key here}as auvred shows in Newly published versions of package managers distributed from npm cannot be installed due to key id mismatch #612 (comment). - For older version inaccessibility (like pnpm@8, 9.6.0), we can use
COREPACK_DEFAULT_TO_LATEST=0to skip unnecessary fetching of latest version.
Reacted by vytas-maciulskis, Jozef Hollý, Gabe, Adrian Kunz, Steven, Mike McCready and Vanisper- For new version inaccessibility (like pnpm@10), we can use
Do you have some steps to reproduce for this issue?
The error I have shown above in description section is same as #612 #613.
To reproduce, use corepack 0.30 or earlier and tries to call pnpm without having local version cache at~/.cache/node/corepack/lastKnownGood.json.This issue is mainly about future similar issues so no real-world reproduction steps are there with latest corepack 0.31.
We can simulate the problem by
COREPACK_INTEGRITY_KEYS={}(remove all recognized keys) without local cache with corepack 0.31.The error I have shown above in description section is same as #612 #613. To reproduce, use corepack 0.30 or earlier and tries to call pnpm without having local version cache at
~/.cache/node/corepack/lastKnownGood.json.This issue is mainly about future similar issues so no real-world reproduction steps are there with latest corepack 0.31.
We can simulate the problem by
COREPACK_INTEGRITY_KEYS={}(remove all recognized keys) without local cache with corepack 0.31.Thank you! Now I understand. This is quite likely to happen in CI where the cache isn't preserved between runs.
These steps will reproduce the issue:
npm install corepack@0.30.0 -g cd $(mktemp -d) corepack use pnpm@9.15.0 rm -rf ~/.cache/node/corepack corepack enable pnpm install
fetchLatestStableVersioncauses the issue.It does not happen with Yarn yet because there is not yet a release which is signed with a new key.I have reproduced this issue in:
https://github.com/MikeMcC399/github-action/blob/test/corepack-pnpm-9.15.4/.github/workflows/example-basic-pnpm.yml for
pnpm@9.15.4(which was signed with the old keyjl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA)$ npm view pnpm@9.15.4 dist.signatures.keyid SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzAWorkaround
Set environment variable:
COREPACK_DEFAULT_TO_LATEST=0
or in GitHub Actions
env: COREPACK_DEFAULT_TO_LATEST: 0
Reacted by Steven- added a commit that references this issue
on Aug 6, 2026
Summary
Please don't make error hard error of resolving latest version when
packageManagerfield is specified.It might be good to not resolve latest version when
packageManagerfield is specified.Description
Many projects recently experience error
Error: Cannot find matching keyid:when we callpnpmthoughcorepack.The thing triggered this error is the recent update of the npmjs.org integrity key.
corepackhard-coded the integrity key of npmjs.org, and it was updated recently, but corepack in many PCs and CIs are not updated yet since they are generally bundled in nodejs.However, this error came from fetching the latest version of package manager, which is not necessary for projects who specify
packageManagerfield.Therefore, I think errors came from fetching the latest version of package manager should not be hard error.
I think not making a hard error will prevent future breakage.
Related: #613 #612 #616