Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node.js LTS rollout of minimum Corepack 0.31.0? #627

Open
MikeMcC399 opened this issue Feb 3, 2025 · 10 comments
Open

Node.js LTS rollout of minimum Corepack 0.31.0? #627

MikeMcC399 opened this issue Feb 3, 2025 · 10 comments

Comments

@MikeMcC399
Copy link
Contributor

MikeMcC399 commented Feb 3, 2025

Issue

New releases of pnpm and npm signed with the new npm "keyid": "SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U" published to https://registry.npmjs.org/-/npm/v1/keys cannot be installed with the version of Corepack currently distributed with Node.js LTS versions without using workarounds.

For instance,

corepack install -g pnpm@9

executed using Node.js 22.13.1 Active LTS (with bundled corepack@0.30.0) on Ubuntu 24.04.1 LTS results in the error "Cannot find matching keyid":

$ corepack install -g pnpm@9
Installing pnpm@9.15.5...
Internal 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=="}]}

The same problem can be expected to affect any new releases of Yarn Modern aka berry. Yarn v1 Classic is frozen, but could also be affected if security fixes are released.

Request

Please clarify if minimum corepack@0.31.0 will be rolled out to Node.js Maintenance and Active LTS status versions 18.x, 20.x and 22.x.

Note: corepack@0.31.0 is already rolled out in the Current Node.js 23.7.0 version.

Related

Workaround

In some situations it is possible to follow the README > Manual Installs section and execute the following to pull in a corrected version of Corepack with updated keys from https://registry.npmjs.org/-/npm/v1/keys:

npm install -g corepack@0.31.0
@MikeMcC399
Copy link
Contributor Author

Current bundled Corepack versions for supported Node.js versions are:

Node.js Corepack
v18.20.6 0.29.4
v20.18.2 0.29.4
v22.13.1 0.30.0
v23.7.0 0.31.0

@MikeMcC399

This comment has been minimized.

@richardlau
Copy link
Member

Corepack 0.31.0 should make it's way into Node.js LTS eventually. The default general policy is for things to be in a current release (i.e. at this time Node.js 23) for two weeks before being eligible for LTS. Node.js 23.7.0 just came out last week (30 Jan), so normally we'd be looking at this being eligible for LTS releases after the end of next week.

cc @nodejs/releasers

@MikeMcC399
Copy link
Contributor Author

@richardlau

Corepack 0.31.0 should make it's way into Node.js LTS eventually. The default general policy is for things to be in a current release (i.e. at this time Node.js 23) for two weeks before being eligible for LTS. Node.js 23.7.0 just came out last week (30 Jan), so normally we'd be looking at this being eligible for LTS releases after the end of next week.

Thank you very much for filling me in on the release processes! I know what to expect now.

@stevebeauge
Copy link

stevebeauge commented Feb 3, 2025

Why can't one simply update corepack itself?

I can run npm install -g corepack@latest. It will install the latest version of corepack. It won't work however (at least on windows), because C:\Program Files\nodejs (which contains corepack executable) appears in the PATH env before C:\Users\myuser\AppData\Roaming\npm.

Is there any hard link between nodejs and corepack ?

@MikeMcC399
Copy link
Contributor Author

@stevebeauge

Why can't one simply update corepack itself?

I can run npm install -g corepack@latest. It will install the latest version of corepack. It won't work however (at least on windows), be cause C:\Program Files\nodejs (which contains corepack executable) appears in the PATH env before C:\Users\myuser\AppData\Roaming\npm.

Is there any hard link between nodejs and corepack ?

I've been able to update Corepack on Windows 11. I suggest you open a separate issue for your problem as it probably depends on how you have installed Node.js and other environment parameters.

@reconbot
Copy link

reconbot commented Feb 6, 2025

While one can update corepack this breaks all installs on CI servers who use LTS, even if they use the latest version of LTS (like on github actions) until this bubbles down to being installed by default. This will be a significant amount of failures.

EDIT: it does look like we're working to prevent this from happening in the future #616

I don't know if it's possible to make an exception on waiting for release as this is a large impact.

@MikeMcC399
Copy link
Contributor Author

@reconbot

  • In some cases it's possible to update Corepack on top of a Node.js LTS installation. It looks like a lot of users are working around it like this at the moment judging by postings in the https://github.com/pnpm/pnpm/issues list.

  • I mentioned some of the delays in Saveguards for keyid mismatch #616 (comment) . It's not just a question of Node.js picking up the Corepack version, but then often the next stage in the supply chain, like GitHub Actions or Docker images, needs to pick this up as well. There probably isn't a one-size-fits-all solution at the moment.

@MikeMcC399
Copy link
Contributor Author

MikeMcC399 commented Feb 7, 2025

@stevebeauge

  • See How to corepack self update? #305 (comment) if you installed Node.js on Windows using an msi package. You need to disable the msi Corepack feature before attempting to install a newer version of Corepack using npm, otherwise they clash.

Edit: This is now added to the Manual installs section of the README document.

xtexx added a commit to AOSC-Dev/aosc-os-abbs that referenced this issue Feb 8, 2025
This resolves the same error as in PR 9597 for nodejs 20.x, updating
Corepack's pinned registry public keys.

Patch 1 (update corepack to 0.30.0) is included in
nodejs v20.18.3 proposal and should be removed in the next nodejs
update.
Patch 2 (update to 0.31.0) is not included in that proposal and should
be removed after two new nodejs 20.x releases.

Link: nodejs/node#56699
Link: nodejs/corepack#627
Link: https://github.com/nodejs/corepack/releases/tag/v0.31.0
Link: https://github.com/nodejs/corepack/releases/tag/v0.30.0
Link: nodejs/node@f7131cf
Link: nodejs/node@63c1859
Link: nodejs/node#55977
Link: nodejs/node#56795
Link: #9597
Backport-of: f7131cf178231f578f1da2aa7ff52a427c953b98
Backport-of: 64ee8a025815553af30d9d273e2f2d07a5eb83ea
Reviewed-by: xtex <xtex@aosc.io>
Signed-off-by: xtex <xtex@aosc.io>
MingcongBai pushed a commit to AOSC-Dev/aosc-os-abbs that referenced this issue Feb 9, 2025
This resolves the same error as in PR 9597 for nodejs 20.x, updating
Corepack's pinned registry public keys.

Patch 1 (update corepack to 0.30.0) is included in
nodejs v20.18.3 proposal and should be removed in the next nodejs
update.
Patch 2 (update to 0.31.0) is not included in that proposal and should
be removed after two new nodejs 20.x releases.

Link: nodejs/node#56699
Link: nodejs/corepack#627
Link: https://github.com/nodejs/corepack/releases/tag/v0.31.0
Link: https://github.com/nodejs/corepack/releases/tag/v0.30.0
Link: nodejs/node@f7131cf
Link: nodejs/node@63c1859
Link: nodejs/node#55977
Link: nodejs/node#56795
Link: #9597
Backport-of: f7131cf178231f578f1da2aa7ff52a427c953b98
Backport-of: 64ee8a025815553af30d9d273e2f2d07a5eb83ea
Reviewed-by: xtex <xtex@aosc.io>
Signed-off-by: xtex <xtex@aosc.io>
@MikeMcC399
Copy link
Contributor Author

Corepack Download stats give some indication of the impact that the currently bundled versions of Corepack are having. There is a ten-fold increase in downloads at this time.

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants