Skip to content

Add optional same-major fallback for project version files - #1615

Open
pederbe wants to merge 1 commit into
Schniz:masterfrom
pederbe:contrib/1500-same-major-fallback
Open

pederbe wants to merge 1 commit into
Schniz:masterfrom
pederbe:contrib/1500-same-major-fallback

Conversation

@pederbe

@pederbe pederbe commented Nov 4, 2026

Copy link
Copy Markdown

Repositories with exact version pins currently prompt to install each missing version, even when a newer version of the same major is already installed.

Add --fallback-to-latest-in-major to opt into the latest newer installed stable version when fnm use reads a missing exact stable version from a file. For example, a missing .nvmrc pin of 20.6.1 can select an installed 20.20.0. Enable it alongside automatic switching:

eval "$(fnm env --use-on-cd --shell bash --fallback-to-latest-in-major)"

Exact installed matches still win. Explicit version arguments, aliases, prerelease requests, engines ranges and other commands keep their existing behavior. Fallback stays within the requested major and does not download a version. The selection message identifies both versions.

The existing Corepack alias test now uses a named LTS that bundles Corepack. Its previous lts/* fixture fails on the unchanged base because the latest LTS no longer includes the executable. The adjacent test still covers latest-LTS alias installation.

Closes #1500.

@pederbe
pederbe marked this pull request as ready for review November 4, 2026 10:15

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Option to resolve to later (same major) version

1 participant