nodejs / nodejs/corepack

Corepack install -g doesn't update known good releases

Open
#503 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
3.8k
Forks
279
Avg merge
1h 47m
Merged PRs (30d)
2

Description

The documentation states that the known good releases of system wide binaries can be updated using corepack install -g:

Known Good Releases
When running Corepack within projects that don't list a supported package manager, it will default to a set of Known Good Releases.
If there is no Known Good Release for the requested package manager, Corepack looks up the npm registry for the latest available version and cache it for future use.
The Known Good Releases can be updated system-wide using corepack install -g. When Corepack downloads a new version of a given package manager on the same major line as the Known Good Release, it auto-updates it by default.

and

Package managers thus installed will be configured as the new default when calling their respective binaries outside of projects defining the packageManager field.

Yet when I tell corepack to install yarn@1.22.22 globally, and try to invoke yarn --version it tells me that yarn is using yarn@1.22.19. I have cleaned my cache and attempted to install yarn@1.22.22 globally and then attempt to invoke yarn before the default would get downloaded but I get a prompt telling me to use yarn@1.22.19.

image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the report with corepack install -g yarn@1.22.22, then run yarn --version after clearing the cache as described. Trace how the global install updates Known Good Releases and verify that invoking Yarn uses 1.22.22 rather than 1.22.19.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.