-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add automatic corepack support for node v14 + #482
base: main
Are you sure you want to change the base?
Add automatic corepack support for node v14 + #482
Conversation
Struggling to get a test to pass. Insight appreciated |
Probably wrong on the test, but since it is asserting the desired corepack output I'm marking this PR ready for review. Hopefully a maintainer more familiar with the test suite can provide some input on how to improve the tests. |
Thanks for opening this PR. I support the idea. |
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.
We also need to consider caching the result of corepack so that it doesn't need to install the package manger each time.
Added a check for the I almost want to try writing an integration test for this, but would appreciate some input from the maintainers |
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.
I'm in favor of using Corepack, but have some concerns about the implementation:
This doesn't seem to support the@version
syntax, which is automatically used in Yarn 3.1, and documented as experimental in Node. We'd have to at least allow for this syntax to set the package manager properly, though it would be nice to also parse the version and use it by default.- GitHub runners already have Yarn installed. You're technically supposed to uninstall Yarn before enabling Corepack, as the global Yarn binary would conflict with Corepack's Yarn shim. We could try to fix this by either uninstalling Yarn before enabling Corepack, or removing Yarn from GitHub's runner (which would be a breaking change but would standardize behavior in the long run).
@nickmccurdy
|
Oh sorry, I see what you mean. It's not actually parsing the
GitHub Actions seems to run |
@Ethan-Arrowood Are you planning to update this PR based on the feedback that has been provided? I know a lot of people are still interested in this feature. I see that CI is also failing currently. |
Looking at this PR again, it could be considered semver major because it will suddenly opt into corepack when the package.json is detected. I'm starting to think that PR #651 is better solution because it could be considered semver minor due to the manual opt in. That could prove valuable if anything changes in the future, since corepack is still technically experimental. |
* docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Description:
Executes
corepack enable
when the detected node version is 14+. This will enable support for thepackageManager
field foryarn
andpnpm
Related issue:
#480
Check list: