-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prefer using exclusively Corepack when possible #4254
Conversation
If there is no |
I've added a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs tests
If Corepack is not enabled (which is by default), wouldn't this make Yarn classic (1.x) come into action? I think it should create a stub/placeholder binary to let people know Corepack is required for the time being, and ignore it in binary comparison. |
The PR title isn't accurate at the moment; Yarn will prefer using exclusively Corepack when possible, but if it isn't enabled (COREPACK_ROOT isn't in the environment) it'll fallback on |
I was thinking of situations where a project created on an environment with Corepack enabled (hence no |
Yes, in that situation it won't work in the current state. To address that I'm considering adding Corepack support to the Yarn 1.x distribution (but only for the |
What's the problem this PR addresses?
Node 14 will soon be the new Node LTS. Since it ships with Corepack, we don't need to store the version file unless users already expect really want it.
How did you fix it?
The new code detects whether there's a
yarnPath
setting. If there is, it assumes that the version file will be needed. Otherwise, it just updates thepackageManager
field.Checklist