`corepack prepare` with a range of versions is unexpected
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 3.8k
- Forks
- 279
- Avg merge
- 1h 47m
- Merged PRs (30d)
- 2
Description
corepack prepare command with a range of versions behaves differently than expected.
Case 1
When:
yarn@3.2.3is the latest published version- no local cache (In OSX,
$HOME/.cache/node/corepack/yarnis empty)
Actually:
$ corepack prepare yarn@~3.2.0
Usage Error: Failed to successfully resolve '~3.2.0' to a valid yarn release
My expectation:
corepack installs yarn@3.2.3 in the local cache.
Case 2
When:
yarn@3.2.3is the latest published version- Only
yarn@3.2.1is in the local cache
Actually:
$ corepack prepare yarn@~3.2.0
Preparing yarn@~3.2.0...
but no additional versions are installed.
There is nothing but yarn@3.2.1 in the local cache.
My expectation:
corepack installs yarn@3.2.3 in the local cache.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the corepack prepare command and reproduce both reported cases: an empty cache and a cache containing yarn@3.2.1. Trace how the requested ~3.2.0 range is resolved and cached, then verify that the latest matching release is installed in both cases.
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
- 45/100