You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Newly published versions of package managers distributed from npm cannot be installed due to key id mismatch #612
I assume the signatures are generated by npm registry and pnpm has no control over it. I'll change the issue name to specifically 10.1.0, but I believe any versions that are published from now on will be affected, as I think it's caused by npm registry's key rotation.
I wonder if the npm registry had to rotate the key immediately (and not in a gradual manner) due to some vulnerability discovery.
changed the title [-]Newly published versions of package managers distributed from npm cannot be installed due to key id mismatch[/-][+]`pnpm@10.1.0` cannot be installed due to key id mismatch[/+]on Jan 27, 2025
For those who are facing this issue like me, you can add COREPACK_INTEGRITY_KEYS=0 env var to skip the signature check.
Reacted by Sebastian "Sebbie" Silbermann, Magnus Klingenberg, philibeaux, Gerrit, Michael de Wit, Julian Pufler, Fortas Abdeldjalil, tretail, Sanghin, Aldo D'Aquino and 5 more
changed the title [-]`pnpm@10.1.0` cannot be installed due to key id mismatch[/-][+]`pnpm@10.1.0` / `pnpm@9.15.4` cannot be installed due to key id mismatch[/+]on Jan 27, 2025
For those who are facing this issue like me, you can add COREPACK_INTEGRITY_KEYS=0 env var to skip the signature check.
Whilst this may work around the issue and is tempting, if there is an undisclosed vulnerability behind all of this as you speculate, then ignoring the key integrity might result in running evil code.
Reacted by kii, Angelo, carl_tablante, nobuya, david-sykora, David Vaness, Philipp Molitor, Magnus Klingenberg, Gerrit, Julian Pufler and 6 more
I assume the signatures are generated by npm registry and pnpm has no control over it. I'll change the issue name to specifically 10.1.0, but I believe any versions that are published from now on will be affected, as I think it's caused by npm registry's key rotation. I wonder if the npm registry had to rotate the key immediately (and not in a gradual manner) due to some vulnerability discovery.
For those who are facing this issue like me, you can add COREPACK_INTEGRITY_KEYS=0 env var to skip the signature check.
Whilst this may work around the issue and is tempting, if there is an undisclosed vulnerability behind all of this as you speculate, then ignoring the key integrity might result in running evil code.
Isn't it the opposite? If the key was rotated, the old key cannot be trusted and the new key can be trusted. The current corepack only checks the old key. To be strictly safe, you shouldn't install any packages signatured with the old key and only use packages signatured with the new key, and given that corepack does not check the signature with the new key, you need to manually check it.
While using the latest-10 tag is not working right now, a pinned version can help to get your CI running 🐌
corepack prepare pnpm@10.0.0 --activate
Reacted by Jonathan Netley, Nathan Romike, Oscar Hermoso, oleole39, adamkaczmar-cc, Jordan Grace, James Potgieter, Janis, Shubhansh Vatsyayan, Amin Mohamed Ajani and 7 more
Reacted by Amin Mohamed Ajani and Vladimir Kalinichev
I ended up installing pnpm@10.0.0 globally (can be done with their one-liner / npm install --global pnpm@10.0.0 / mise / etc.). New v10 has manage-package-manager-versions enabled by default, which substitutes corepack. When inside a project directory, globally installed pnpm v10 checks package.json → packageManager and automatically substitutes itself with the exact version specified.
So unless you rely on corepack to manage Yarn as well, it is no longer needed. The only exception I see is CI when you can avoid two pnpm downloads with one, via corepack enable.
RUN npm install -g corepack@latest
RUN corepack enable && corepack prepare --activate
Sorry, I'm not familiar in-depth with the deprecated commands, but I believe that they should still work even if the local documentation has been dropped for them.
latest won't work for us as this our production build. But thanks for taking the time, really appreciate it! 🙏
We'll stick with prepare --activate until we can bump the version to v.0.31.0
JavaScript GitHub Actions are also impacted where Corepack is used inside an action. It's not possible to update Corepack inside the action. It needs Node.js to distribute a new version of Corepack and GitHub Actions needs to set this version corresponding to the runs.using parameter.
While using the latest-10 tag is not working right now, a pinned version can help to get your CI running 🐌
corepack prepare pnpm@10.0.0 --activate
This worked for my Dockerfile and Node 23.6.1
RUN corepack prepare pnpm@10.0.0 --activate && corepack enable pnpm && pnpm run build
JavaScript GitHub Actions are also impacted where Corepack is used inside an action. It's not possible to update Corepack inside the action. It needs Node.js to distribute a new version of Corepack and GitHub Actions needs to set this version corresponding to the runs.using parameter.
And looks like Node already updated Corepack as specifying the latest Node (23.7.0) in my Docker file I'm able to run it as usual
corepack enable pnpm && pnpm run build
That is correct. Node.js 23.7.0 already contains Corepack 0.31.0
The Node.js maintainers replied in Node.js LTS rollout of minimum Corepack 0.31.0? #627 (comment) that there is a policy to first test in the current version Node.js 23.x before releasing into the Node.js LTS versions. So that is not going to happen overnight.
In my github actions for a job that basically install Node, npm and pnpm while I have "packageManager": "pnpm@9.12.3" in my package.json. Yet, I still get the error in my github's CI... Is there a way to explicitly target corepack 0.31.0 (the one with the key fix) without bumping to ode 23 (which is not LTS yet)
I would recommend against curl the registry keys or the shasum; though it can unblock you, you have to understand you are trusting HTTPS when doing that, and you might as well disable signature verification at this point (the signature verification is a redundant security mechanism that only makes sense to do if you are not fetching the keys via HTTPS).
Ideally the workaround would be to use latest version of Corepack. However, if that's not an option, you can either:
If you trust HTTPS, set COREPACK_INTEGRITY_KEYS to 0 to skip the signature verification. Corepack will still verifies the integrity of the download by comparing the shasum with the one found in the registry package metadata.
If you don't trust HTTPS, set COREPACK_INTEGRITY_KEYS to {"npm":[{"expires":"2025-01-29T00:00:00.000Z","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","keytype":"ecdsa-sha2-nistp256","scheme":"ecdsa-sha2-nistp256","key":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE1Olb3zMAFFxXKHiIkQO5cJ3Yhl5i6UPp+IhuteBJbuHcA5UogKo0EWtlWwW6KSaKoTNEYL7JlCQiVnkhBktUgg=="},{"expires":null,"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","keytype":"ecdsa-sha2-nistp256","scheme":"ecdsa-sha2-nistp256","key":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEY6Ya7W++7aUPzvMTrezH6Ycx3c+HOKYCcNGybJZSCJq/fd7Qa8uuAKtdIkUQtQiEKERhAmE5lMMJhP8OkDOa2g=="}]}.
Reacted by Martin Šťovíček, Artur Sudnik-Hrynkiewicz and LucienLeMagicien
Perhaps it would be good to lock this thread to contributors? Any solutions to the problem as it exists now have already been added to this thread, and further comments just add noise that serves no purpose as long as Corepack is not upgraded in actively supported versions of Node.js.
Reacted by Gabriel, Wes Rice, Mike McCready, Joost Kersjes, vuxnh, zSkyTikz, Stefan Probst, hansruebenichs, Artur Sudnik-Hrynkiewicz, Nagy Máté and 3 more
This might be a dumb question, but who screwed up here? Was this just a case of all of us not correctly configuring our CI pipelines and being vulnerable to some latent "behavior" of corepack/npm, or was something actively changed to "cause" this? I ask not to place blame, but to better understand what happened for future reference.
Reacted by Ruben van Dijk, Jim Brännlund, toni, Oskar Janczak, Théo LUDWIG, Maxim Rubis and min-cmr
This might be a dumb question, but who screwed up here? Was this just a case of all of us not correctly configuring our CI pipelines and being vulnerable to some latent "behavior" of corepack/npm, or was something actively changed to "cause" this? I ask not to place blame, but to better understand what happened for future reference.
This issue was triggered by npm rotating the keys that sign packages on its registry. There was a bug in Corepack that, when no "global" version was cached, would always first download the latest one even if a specific one was defined in the package.json; when npm rotated its key and pnpm and npm released new versions soon after, Corepack started failing on CI as those environment typically do not have any cached version.
Corepack released a new version with the new key ASAP, but it takes a while for that version to propagate; the experimental status of Corepack did not help, as the Node.js project does not make emergency non-security releases for experimental features. It has since then decided that Node.js 24.x will be the last release line that distributes Corepack (i.e. as of Node.js 25.0.0, users who wish to keep using Corepack would have to install it separately, read more about this in https://socket.dev/blog/node-js-tsc-votes-to-stop-distributing-corepack).
The bug that made CI fetch a "global" version was fixed, so next time npm rotates its key, CI would not be affected as long as the project provides a specific version and a hash in the packageManager field. There's an open PR to make Corepack auto-download new keys.
Activity
MikeMcC399 commentedon Jan 27, 2025
@sapphi-red
I can reproduce this issue on Windows 11 and Ubuntu
24.04.1LTS withhas no issue, so you might change your subject to be specifically
10.1.0instead of the generic "Newly published versions".Also, this should probably be reported to https://github.com/pnpm/pnpm/issues
cc: @zkochan
SenseiMarv commentedon Jan 27, 2025
I can confirm that the same issue happens for us as well in our GitLab Pipeline:
sapphi-red commentedon Jan 27, 2025
I assume the signatures are generated by npm registry and pnpm has no control over it. I'll change the issue name to specifically
10.1.0, but I believe any versions that are published from now on will be affected, as I think it's caused by npm registry's key rotation.I wonder if the npm registry had to rotate the key immediately (and not in a gradual manner) due to some vulnerability discovery.
[-]Newly published versions of package managers distributed from npm cannot be installed due to key id mismatch[/-][+]`pnpm@10.1.0` cannot be installed due to key id mismatch[/+]sapphi-red commentedon Jan 27, 2025
For those who are facing this issue like me, you can add
COREPACK_INTEGRITY_KEYS=0env var to skip the signature check.DaveEvans-Thalamos commentedon Jan 27, 2025
We're pinned to
9.15.4and seeing this on CI, so it's not limited to10.1.0[-]`pnpm@10.1.0` cannot be installed due to key id mismatch[/-][+]`pnpm@10.1.0` / `pnpm@9.15.4` cannot be installed due to key id mismatch[/+]DaveEvans-Thalamos commentedon Jan 27, 2025
Whilst this may work around the issue and is tempting, if there is an undisclosed vulnerability behind all of this as you speculate, then ignoring the key integrity might result in running evil code.
MikeMcC399 commentedon Jan 27, 2025
@sapphi-red
sapphi-red commentedon Jan 27, 2025
Isn't it the opposite? If the key was rotated, the old key cannot be trusted and the new key can be trusted. The current corepack only checks the old key. To be strictly safe, you shouldn't install any packages signatured with the old key and only use packages signatured with the new key, and given that corepack does not check the signature with the new key, you need to manually check it.
sapphi-red commentedon Jan 27, 2025
I've sent a message there linking this and that issue 👍
MikeMcC399 commentedon Jan 27, 2025
cannot find matching keyidpnpm/pnpm#9014hmaack commentedon Jan 27, 2025
While using the
latest-10tag is not working right now, a pinned version can help to get your CI running 🐌Fix pnpm test
kachkaev commentedon Jan 27, 2025
I ended up installing
pnpm@10.0.0globally (can be done with their one-liner /npm install --global pnpm@10.0.0/ mise / etc.). New v10 hasmanage-package-manager-versionsenabled by default, which substitutescorepack. When inside a project directory, globally installed pnpm v10 checkspackage.json→packageManagerand automatically substitutes itself with the exact version specified.So unless you rely on corepack to manage Yarn as well, it is no longer needed. The only exception I see is CI when you can avoid two
pnpmdownloads with one, viacorepack enable.91 remaining items
BeyondEvil commentedon Feb 3, 2025
latestwon't work for us as this our production build. But thanks for taking the time, really appreciate it! 🙏We'll stick with
prepare --activateuntil we can bump the version tov.0.31.0MikeMcC399 commentedon Feb 3, 2025
@BeyondEvil
So does that mean you can't use
npm install -g corepack@0.31.0either?You're very welcome! I'm just trying to work out how to use Corepack for my own purposes and seem to have got caught up in events here!
MikeMcC399 commentedon Feb 3, 2025
JavaScript GitHub Actions are also impacted where Corepack is used inside an action. It's not possible to update Corepack inside the action. It needs Node.js to distribute a new version of Corepack and GitHub Actions needs to set this version corresponding to the runs.using parameter.
esausilva commentedon Feb 3, 2025
This worked for my Dockerfile and Node 23.6.1
And looks like Node already updated Corepack as specifying the latest Node (23.7.0) in my Docker file I'm able to run it as usual
MikeMcC399 commentedon Feb 3, 2025
@esausilva
That is correct. Node.js
23.7.0already contains Corepack0.31.0FelixBlaisThon commentedon Feb 3, 2025
I have tried
In my github actions for a job that basically install Node, npm and pnpm while I have
"packageManager": "pnpm@9.12.3"in my package.json. Yet, I still get the error in my github's CI... Is there a way to explicitly target corepack 0.31.0 (the one with the key fix) without bumping to ode 23 (which is not LTS yet)I am on Node v22.11.0
MikeMcC399 commentedon Feb 3, 2025
@FelixBlaisThon
Is there a way to explicitly target corepack 0.31.0 (the one with the key fix) without bumping to ode 23 (which is not LTS yet)
In GitHub Actions I used the following:
which works for any version of Node.js.
BeyondEvil commentedon Feb 3, 2025
Technically that would work, but the question becomes how we keep parity between local dev, CI and Docker/production without too much maintenance.
It happens! 😅
Jaciezyt commentedon Feb 3, 2025
@MikeMcC399
It works! Thanks a lot! 👍
aduh95 commentedon Feb 3, 2025
I would recommend against
curlthe registry keys or the shasum; though it can unblock you, you have to understand you are trusting HTTPS when doing that, and you might as well disable signature verification at this point (the signature verification is a redundant security mechanism that only makes sense to do if you are not fetching the keys via HTTPS).Ideally the workaround would be to use latest version of Corepack. However, if that's not an option, you can either:
COREPACK_INTEGRITY_KEYSto0to skip the signature verification. Corepack will still verifies the integrity of the download by comparing the shasum with the one found in the registry package metadata.COREPACK_INTEGRITY_KEYSto{"npm":[{"expires":"2025-01-29T00:00:00.000Z","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","keytype":"ecdsa-sha2-nistp256","scheme":"ecdsa-sha2-nistp256","key":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE1Olb3zMAFFxXKHiIkQO5cJ3Yhl5i6UPp+IhuteBJbuHcA5UogKo0EWtlWwW6KSaKoTNEYL7JlCQiVnkhBktUgg=="},{"expires":null,"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","keytype":"ecdsa-sha2-nistp256","scheme":"ecdsa-sha2-nistp256","key":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEY6Ya7W++7aUPzvMTrezH6Ycx3c+HOKYCcNGybJZSCJq/fd7Qa8uuAKtdIkUQtQiEKERhAmE5lMMJhP8OkDOa2g=="}]}.aeharding commentedon Feb 3, 2025
npm install --global corepack@latestjonkoops commentedon Feb 3, 2025
Perhaps it would be good to lock this thread to contributors? Any solutions to the problem as it exists now have already been added to this thread, and further comments just add noise that serves no purpose as long as Corepack is not upgraded in actively supported versions of Node.js.
tskimmett commentedon Feb 3, 2025
This might be a dumb question, but who screwed up here? Was this just a case of all of us not correctly configuring our CI pipelines and being vulnerable to some latent "behavior" of corepack/npm, or was something actively changed to "cause" this? I ask not to place blame, but to better understand what happened for future reference.
MikeMcC399 commentedon Feb 3, 2025
@tskimmett
This was not caused by end-user error.
aduh95 commentedon Mar 23, 2025
This issue was triggered by npm rotating the keys that sign packages on its registry. There was a bug in Corepack that, when no "global" version was cached, would always first download the latest one even if a specific one was defined in the
package.json; when npm rotated its key and pnpm and npm released new versions soon after, Corepack started failing on CI as those environment typically do not have any cached version.Corepack released a new version with the new key ASAP, but it takes a while for that version to propagate; the experimental status of Corepack did not help, as the Node.js project does not make emergency non-security releases for experimental features. It has since then decided that Node.js 24.x will be the last release line that distributes Corepack (i.e. as of Node.js 25.0.0, users who wish to keep using Corepack would have to install it separately, read more about this in https://socket.dev/blog/node-js-tsc-votes-to-stop-distributing-corepack).
The bug that made CI fetch a "global" version was fixed, so next time npm rotates its key, CI would not be affected as long as the project provides a specific version and a hash in the
packageManagerfield. There's an open PR to make Corepack auto-download new keys.Apologies to everyone who was impacted!