pnpm: Cannot install pnpm with corepack: `corepack use pnpm@latest-x`
Verify latest release
- I verified that the issue exists in the latest pnpm release
pnpm version
9.15.3, 9.15.5
Possibly all versions of pnpm installed via corepack.
Which area(s) of pnpm are affected? (leave empty if unsure)
CLI
Link to the code that reproduces this issue or a replay of the bug
Reproduction steps
This applies to both CI and local environment, fail at run: pnpm install
jobs:
Build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- run: corepack enable pnpm
# Fail here
- run: pnpm install
Describe the Bug
Error message:
Run pnpm install
pnpm install
shell: /usr/bin/bash -e {0}
/opt/hostedtoolcache/node/[2](https://github.com/user/user-app/actions/runs/13104702477/job/36557589587?pr=379#step:6:2)0.18.2/x64/lib/node_modules/corepack/dist/lib/corepack.cjs:215[3](https://github.com/user/user-app/actions/runs/13104702477/job/36557589587?pr=379#step:6:3)5
if (key == null || signature == null) throw new Error(`Cannot find matching keyid: ${JSON.stringify({ signatures, keys })}`);
^
Error: Cannot find matching keyid:
It works before the recent release. I’m assuming 9.15.5 broke something?
Expected Behavior
Expect to download and run pnpm install:
Corepack is about to download https://registry.npmjs.org/pnpm/-/pnpm-9.15.3.tgz
Which Node.js version are you using?
v20.18.2
Which operating systems have you used?
- macOS
- Windows
- Linux
If your OS is a Linux based, which one it is? (Include the version if relevant)
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 191
- Comments: 36 (8 by maintainers)
Commits related to this issue
- pnpm https://github.com/pnpm/pnpm/issues/9029#issuecomment-2629817478 — committed to ygpark80/blog by ygpark80 2 years ago
- ci: temporary fix pnpm / corepack problem * see https://github.com/pnpm/pnpm/issues/9029 — committed to raydak-labs/configarr by BlackDark 2 years ago
- chore: using pnpm from `package.json` Fixes problem with newer pnpm versions: https://github.com/pnpm/pnpm/issues/9029 — committed to renlabs-dev/torus-ts by steinerkelvin 2 years ago
- chore: pin pnpm on Dockerfile Fixes problem with newer pnpm versions: https://github.com/pnpm/pnpm/issues/9029 — committed to renlabs-dev/torus-ts by steinerkelvin 2 years ago
- chore: pin pnpm on Dockerfile Fixes problem with newer pnpm versions: https://github.com/pnpm/pnpm/issues/9029 — committed to renlabs-dev/torus-ts by steinerkelvin 2 years ago
- fix: update totalStake type to bigint and improve code formatting in useAPR hook chore: pin pnpm on Dockerfile Fixes problem with newer pnpm versions: https://github.com/pnpm/pnpm/issues/9029 — committed to renlabs-dev/torus-ts by DaviPtrs 2 years ago
- update deploy workflow - pnpm and corepack were being annoying - see https://github.com/pnpm/pnpm/issues/9029 - decided to use npm instead in the gh workflow — committed to bigmistqke/automerge-monaco-repl by bigmistqke 2 years ago
- fix(https://github.com/pnpm/pnpm/issues/9029): Corepack integrity issue — committed to frontendnetwork/Veganify-API by philipbrembeck 2 years ago
- fix: pin pnpm in corepack https://github.com/pnpm/pnpm/issues/9029 — committed to remoodle/remoodle by wsehl 2 years ago
- Update Dockerfile Try using this approach: https://github.com/pnpm/pnpm/issues/9029#issuecomment-2631400936 — committed to rothnic/firecrawl by rothnic 2 years ago
- fix(server): Fix builds in response to recent corepack issue (#23769) ## Description Builds of server components, which happen inside Docker containers, were broken by a recent issue with corepack +... — committed to microsoft/FluidFramework by alexvy86 2 years ago
- chore: downgrade pnpm version considering the state of corepack installs https://github.com/pnpm/pnpm/issues/9029 — committed to nicolassutter/jobbies by nicolassutter 2 years ago
- Fix corepack and self hosting setup (#1131) * Update Dockerfile Config corepack and pnpm * Update Dockerfile Try using this approach: https://github.com/pnpm/pnpm/issues/9029#issuecomment-26314009... — committed to mendableai/firecrawl by rothnic 2 years ago
- pnpm error workaround https://github.com/pnpm/pnpm/issues/9029 — committed to nichtsam/nichtsam.com by nichtsam 2 years ago
- fix: Corepack pnpm issue (#10840) So, a while back Circle CI builds and Heroku builds started to fail. From all the threads I read, it seems like the [npm registry rotated it's signing keys](https:... — committed to chatwoot/chatwoot by scmmishra 2 years ago
- pnpm error workaround https://github.com/pnpm/pnpm/issues/9029 — committed to nichtsam/nichtsam.com by nichtsam 2 years ago
- fix(build): update corepack before using it Fixes upstream https://github.com/pnpm/pnpm/issues/9029 Resolves https://community.vikunja.io/t/issue-building-docker-image/3345/3 — committed to go-vikunja/vikunja by kolaente 2 years ago
- fix(build): Fix build error due to corepack See details: https://github.com/pnpm/pnpm/issues/9029 — committed to Vizzuality/natural-capital-primer by clementprdhomme 2 years ago
- fix(dev): fix `corepack` issue preventing reinit new container: Refs: - https://github.com/nodejs/corepack/issues/612 - https://github.com/pnpm/pnpm/issues/9029 — committed to lvnam96/homemade-food-app by lvnam96 2 years ago
- fix(dev): fix `corepack` issue preventing reinit new container: Refs: - https://github.com/nodejs/corepack/issues/612 - https://github.com/pnpm/pnpm/issues/9029 — committed to lvnam96/homemade-food-app by lvnam96 2 years ago
You may have installed corepack with
npmpreviously, in which case usingpnpmto upgrade may fail. Usenpminstead:(I suppose you could run
pnpm setupto set the global bin directory and mitigate the error but I didn’t explore this option.)And yes, my corepack version was
0.29.3and once I upgraded it to0.31.0the error went away.This is unfortunately an ongoing issue in corepack: https://github.com/nodejs/corepack/issues/612
It can be bypassed by either:
Updating the global version of corepack:
Or by having corepack not check integrity keys when preparing
pnpm:Just leaving a comment here, if anybody can use our fix. We had this issue in Azure Pipelines. We didn’t pin the PNPM version, so I guess it just used the latest version. By pinning the version in our Pipeline to what we use in DEV, currently
pnpm@9.15.0, we resolved the issue.This is our pipeline setup:
For some reason, we had to separate the script into multiple chunks to get the
corepack preparecommand working.Error: Cannot find matching keyid: {"signatures":[{"sig":"MEQCIHGqHbvc2zImUPEPFpT4grh6rMYslel+lAjFArx8+RUdAiBfnJA+bgmUvO5Lctfkq+46KKDQdx/8RhLPge3pA+EdHA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"keys":[{"expires":null,"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","keytype":"ecdsa-sha2-nistp256","scheme":"ecdsa-sha2-nistp256","key":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE1Olb3zMAFFxXKHiIkQO5cJ3Yhl5i6UPp+IhuteBJbuHcA5UogKo0EWtlWwW6KSaKoTNEYL7JlCQiVnkhBktUgg=="}]}My workaround to deal with this bug:
packageManagerversion topnpm@10.0.0.corepack prepare pnpm@10.0.0 --activateto the Dockerfile:I have tried other pnpm versions, but versions 10.1.0 and 9.15.5 didn’t work.
Update:
Following the info from @zkochan, the corepack version 0.31.0 can also fix this issue:
same error for node:22.11.0-slim image. I might be able to avoid it by running
pnpm installafternpm install --global corepack@latest.If you are using Node.js
22.xLTS there is now a new release with the Corepack fix.Node.js v22.14.0 includes the fixed version: Corepack
0.31.0.As far I understand the corepack team has published a fix in their latest version. So, you can fix the issue by upgrading corepack to latest.
@ARiyou2000
22.x, and it is planned for Node.js20.x. See https://github.com/nodejs/corepack/issues/627#issuecomment-2650915045node:latestyou will have it now.I was able to fix these errors by adding the two commented lines above. Now, pnpm 10.2.0 is working.
If you still encounter issues, you might want to try running
npm install -g corepack@latestfirst. I hope one of these solutions works for you.@AleksandrHovhannisyan
Add
ENV COREPACK_DEFAULT_TO_LATEST=0to yourDockerfileThe
node:20Docker image currently ships with Corepack0.29.4.For <=
pnpm@9.15.4,pnpm@10.0.00.26.00.27.0-0.30.0COREPACK_DEFAULT_TO_LATEST=00.31.0In docker environment
corepack enable && corepack prepare pnpm@9.15.5 --activateworks for me.npm i -g corepack@latestfixed it for me tooyep, updating corepack fixed it for me!
@MikeMcC399 thank you for your prompt response.
A re-installation of corepack has solved the issue.
Thanks again
The error Cannot find matching keyid: ${JSON.stringify({ signatures, keys })} in a Docker build, specifically within the context of PNPM and Corepack, indicates an issue with verifying the signatures of packages being installed. This usually arises due to a mismatch between the expected and actual keys used to sign the packages in the npm registry.
So I Updated my Node version from 20 to 22 and it worked!
This also works for me
@MikeMcC399 hello, Thanks for the response. when i checked the doc before I remember seeing the “use” command but thought that I needed to first install the new version of the pnpm. That is why i used the command corepack install -g and thought there was an error because when i pnpm -v on a directory different from my project it showed the same version (not upgraded it)
Anyway, as a last word, this worked. now that, pnpm -v shows correctly the 10.2.0 version. in my project folder and other folders.
I think I need to read the docs more carefully.
Thanks again alptekin
I also fixed it by changing this:
…to this:
…but that’s only a temporary fix.
Most solutions offer to just upgrade corepack with
npm i -g corepack, but we use Docker, so I believe we’re stuck? I mean, the Docker image ships with a certain version of Node which also comes with the corresponding Corepack version, as that’s an internal Node.js feature.We can’t use version 9.15.4 forever. What would need to happen before we could revert to using
@latest? What does that new version of pnpm have to publish?This work for me
also had this issue, run this in a docker container base step to stop the builds failing we pinned to 9.15.4
FROM node:22-slim AS base ENV PNPM_HOME="/pnpm" ENV PATH="$PNPM_HOME:$PATH" RUN corepack enable && \ corepack prepare pnpm@9.15.4 --activate