Skip enabling Corepack if it's not bundled with Node.js#1566
Open
moposx wants to merge 4 commits into
Open
Conversation
Previously fnm ran `corepack enable` unconditionally, which produced a "No such file or directory" error when the installed Node version did not bundle corepack. Now the installed version is checked against the semver range `^14.19.0 || 16.9.0 - 24.x.x`. If the version doesn't bundle corepack, the step is skipped, instead a hint is given to user to install and enable Corepack via `npm install -g corepack && corepack enable`.
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.
Previously fnm ran
corepack enabledirectly, which could lead to a "No such file or directory" error when the installed Node version did not bundle Corepack.Now the installed version is checked against the semver range
^14.19.0 || 16.9.0 - 24.x.x. If the version doesn't bundle corepack, fnm will just skip enabling Corepack and leave the user a hint to install and enable Corepack manually vianpm install -g corepack && corepack enable.This will serve as a workaround as #1398, #1469 are still open, and can provide clarity if a user runs into issues like #1554.