berry icon indicating copy to clipboard operation
berry copied to clipboard

docs: add corepack prepare to update global yarn

Open mrienstra opened this issue 1 year ago • 0 comments

What's the problem this PR addresses? Corepack won't always have the latest Yarn release installed globally. It would be helpful to provide instructions on how to go about ensuring it does.

https://github.com/yarnpkg/berry/pull/4815 attempted to address that, but was reverted because it didn't specify which versions of Node.js have Corepack >=0.12 (and thus support using a dist-tag instead of a version number when running corepack prepare).

...

How did you fix it? Added new section to docs (based on https://github.com/yarnpkg/berry/pull/4815) providing appropriate commands depending on the version of Node.js.

As I'm writing this, I'm wondering if I should edit it slightly to clarify that the underlying reason it matters which version of Node.js you're using is because of the need to know if you are using Corepack >=0.12 or <0.12. I think it's possible to change the version of Corepack associated with a given Node.js install, though I'm guessing that would be pretty unusual unless you're using a pre-Corepack version of Node.js.

References: Corepack v0.120 Node.js v18.6.0 Node.js v16.17.0

...

Checklist

  • [ ] I have set the packages that need to be released for my changes to be effective.
  • [x] I will check that all automated PR checks pass before the PR gets reviewed.

mrienstra avatar Sep 15 '22 05:09 mrienstra