berry icon indicating copy to clipboard operation
berry copied to clipboard

Docs on Corepack need to be expanded

Open PaulRBerg opened this issue 9 months ago • 7 comments

Yarn's docs on Corepack should be expanded to explain:

  • Whether Corepack is required for Yarn Berry, or it's just a nice way of installing the CLI
  • What will Yarn do about the fact that Node.js is removing support for Corepack
  • What happens when Corepack is not used, i.e., there's a Yarn executable under .yarn/releases, etc.
  • What happens when Corepack is used, i.e., there's no Yarn executable and Corepack handles that

URL: https://yarnpkg.com/corepack

Related: https://github.com/yarnpkg/berry/discussions/5949

PaulRBerg avatar Mar 16 '25 14:03 PaulRBerg

What will Yarn do about the fact that Node.js is removing support for Corepack

They are not, a vote is in progress as of last week. The thread you link is a non-binding circlejerk.

If Node.js decides to neuter Corepack in any way (which we'll see depending on the results of the vote) we'll take notice and act accordingly.

arcanis avatar Mar 16 '25 17:03 arcanis

The TSC voted to remove corepack in a future (25+) release:

Winning candidate: Phase out later: stop distributing Corepack (i.e. the distribution will no longer contain a corepack executable) on future (i.e. 25+) release lines of Node.js – existing release lines as well as the very next (i.e. 24.x) will keep it as experimental.

https://github.com/nodejs/TSC/pull/1697#issuecomment-2737093616

BurningEnlightenment avatar Mar 19 '25 15:03 BurningEnlightenment

I updated the getting started page, help welcome to update other references in the doc.

What will Yarn do about the fact that https://github.com/nodejs/package-maintenance/pull/606

As for long-term plans it's a little soon to be certain what the alternative to Corepack will be, but I believe likely we'll keep the versioning mechanism while using a different implementation than Corepack. For the moment I'm focusing on the next two Yarn majors, and once this job is done we'll have more clarity as to what we need.

arcanis avatar Mar 19 '25 16:03 arcanis

The vote does not change much. The Node.js TSC decided to continue distributing Corepack with the next release of Node.js which is 24.x and has end-of-life in April 2028. Users who start in Oct 2025 with Node.js 25.x when it's released would install Corepack with npm, unless Corepack adds a different mechanism to install it in the meantime. Many pnpm users are already installing Corepack with npm due to a package signing issue that occurred in Jan 2025, and which required updating independently of the Node.js version, so there is no hard reliance on Corepack being distributed with Node.js.

MikeMcC399 avatar Mar 19 '25 18:03 MikeMcC399

For me the barrier to using Corepack in production is that it is marked as experimental. I don't care though if I need to install it manually instead of having it delivered together with Node.js.

I would need to see it declared as stable with an on-going support commitment and endorsement for use in production.

https://nodejs.org/docs/latest/api/corepack.html has it in the category Experimental "Non-backward compatible changes or removal may occur in any future release. Use of the feature is not recommended in production environments."

MikeMcC399 avatar Mar 20 '25 11:03 MikeMcC399

@MikeMcC399 do you recommend installing yarn directly via npm in a production script? (instead of via corepack)

npm install --global @yarnpkg/[email protected]

dcorking avatar May 21 '25 08:05 dcorking

@dcorking

@MikeMcC399 do you recommend installing yarn directly via npm in a production script? (instead of via corepack)

npm install --global @yarnpkg/[email protected]

  • There is a separate discussion in https://github.com/yarnpkg/berry/issues/6443 about running Yarn (Modern) without Corepack. I have never done this, so I can't advise. It would need some statement and support from the Yarn team, like from @arcanis to be recommended.

MikeMcC399 avatar May 21 '25 08:05 MikeMcC399