Repository navigation
fix(use): select the default version when offline - #905
Open
Aschenbath wants to merge 1 commit into
Open
Aschenbath wants to merge 1 commit into
Aschenbath wants to merge 1 commit into
Conversation
Signed-off-by: Nash Aschenbath <wwh86696@163.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
corepack use yarncurrently queries registry version lists even aftercorepack install -g yarn@4.8.0. WithCOREPACK_ENABLE_NETWORK=0, this fails although the selected default is cached.When the network is disabled and the version is omitted (including
yarn@), use the existing default-version resolver after loading.corepack.env. This preserves the selected Last Known Good release and its integrity hash even when a newer release is cached. Online resolution and explicit versions, tags, and ranges retain their existing behavior. The command help and README describe the offline behavior.Fixes #704.
Validation on Node.js 22.23.3 in WSL:
corepack yarn build,corepack yarn typecheck, andcorepack yarn lint --max-warnings=0passed.NOCK_ENV=replay corepack yarn test run --retry=0: 180 passed and one existing expected failure across eight files. The nine new regressions include default selection,.corepack.env, explicit requests, a missing default, and online resolution. Before the production fix, three regressions failed and the other 14UseCommandtests passed; all 17 pass with the fix.use yarnselected the 4.8.0 default, wrote its integrity hash, and completed installation. Explicituse yarn@4.18.0also worked;use yarn@latestfailed without changing the manifest.Cross-platform CI passed all ten jobs at
a9575754509fcea9b7f2f85fae1bdb5852def35b: the existing Tests workflow on Node.js 22, 24, and 26 across Linux, macOS, and Windows, plus type and lint checks. The upstream workflow still requires maintainer approval.Implementation and automated validation were performed by Codex.