-
-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
corepack
installed with node@20
but not with node@22
#193982
Comments
Further BackgroundAfter doing a bit of research in the Homebrew repository, I can see the following:
I originally reported this over in the Node.js repository: And received a response that this should be reported here. |
Hey Homebrew maintainers (@carlocab @SMillerDev @bevanjkay @chenrui333 @cho-m), I'm Claudio, one of the core collaborators of Node.js, I'm chiming in here as I've never noticed that Homebrew intentionally removed core features from Node.js (https://github.com/Homebrew/homebrew-core/blob/master/Formula/n/node.rb#L69-L70) on its formulae. This is not a sanctioned way that we (Node.js) approve of people distributing Node.js. This might cause many expectation issues and hinder how we expect community package managers to ship Node. So, I'd like to ask Homebrew maintainers to remove those flags formally. Node.js users expect all installation methods bundled via Node.js version managers, OS package managers, or community package managers to install Node similarly. We cannot endorse Homebrew as a way of installing Node.js if Homebrew intentionally changes (without the user's explicit consent and knowledge) what gets shipped when they install Node. (Note that this is not a threat, although it might sound; We just want to ensure that the official ways we recommend on our website all have the same behaviour)
I'd certainly appreciate it if this behavior is undone. Edit: My side assumed that different versions are shipped, which is incorrect. However, Homebrew is still discouraged from manually bundling npmin an extraneous way. Edit 2: It is important to mention that my statements are not a representation of Node.js as a whole but as someone who is deeply involved with its infrastructure and development. |
I've made a PR here: #194041 but no idea yet if it passes, if the changes are correct; I'll test on my MacBook later :) |
That's not actually accurate -- we always make sure that the homebrew-core/Formula/n/node.rb Lines 49 to 50 in 4a0d38c
If there's been a mismatch historically then that was an oversight. |
Appreciate for chiming in. I raised a question within my PR OOC to better understand Homebrew's deliberate decision here; Apologies for my lack of context here 🙇 |
This is quite an alarming sentence to deliver to send to downstreams and implies NodeJS has a very strong stance against https://opensource.org/osd. Focussing on the pull request in isolation: I'm ok with making changes. The corepack decision came at a time where corepack was still experimental several years ago (and the Node 23 is in a couple days and is an excellent opportunity to make any big changes along with a fresh
But I'm overall OK for removing |
Based on quick check through Repology, this statement doesn't seem to hold up:
Footnotes
|
Yes, agreed. I'll also note that a number of packages mentioned in upstream documentation do some pretty similar things as we do:
Are any/all of these in violation of Node's license? Edit: Got scooped by @cho-m. Didn't see the previous comment till I submitted mine 😄 |
Might be tricky for some dependents to both depend on homebrew-core/Formula/c/corepack.rb Lines 20 to 21 in 1e6e3ab
|
Apologies, this is indeed an unwarranted statement from my side. As per https://github.com/nodejs/node/blob/main/LICENSE, I don't think any license is actually being breached.
I understand that, but there are active conversations within the Node team about whether corepack should be removed or not; removing it from Homebrew install paths at this time is not recommended.
I doubt that the we are aware that this was the case. We don't have control over what package managers decide to do or not with Node, hence I'm reaching out here. I appreciate you for compiling this list, I'm actually shocked that this is the case, and I'm not sure if the Node.js release team is aware of this -- I'll reach them out and check-in. |
I imagined something like this was the case 🤔
I don't want to waste your volunteering time unnecessarily. I would appreciate it if you could check that, but only if that's a reasonable ask from my side. |
Node 23 got delayed a bit, I can check back what is the updated timeline, the irony is that we're facing issues specifically with macOS (nodejs/Release#1034) |
I think the |
Apologies again for the unnecessary and inaccurate statement (regarding LICENSE violations) -- to clarify, my intent here was to refer as the official binaries of Node.js and untethered modifications on them; But this is not applicable (nor actually part of the LICENSE of Node) here as Node is built from source by Homebrew. |
I linked the wrong issue, nodejs/node#55181 |
AFAIK this is not correct, we (Node.js) maintain the
We are certainly aware, AFAICT it's always been a quite transparent process. |
Indeed, concur here.
I partially agree here, but I cannot speak as for Node as a whole, and your statements (as a TSC member) will supersede mine. (Referring to the part of community package managers changing what is bundled or not with default "nodejs" distributions -- I would understand if this was a bottle of
Then this is possibly a me issue. Was there any documentation regarding which OS managers/package managers are deviating from the default "ship" (?) Suppose this is a well-known knowledge (which I unfortunately was unaware of). In that case, we do need to update the Node.js website to reflect that these package managers diverge from other installation methods. Which, in my opinion, is still a breakage of consistency. |
Since @aduh95 has chimed in, I'll defer his opinions as what would be a relay of Node.js will here; If he believes this is completely fine for Homebrew to do, then I believe Homebrew will not need to remove the Having that said, it is hard for me (as someone contributing to Node's infra and website) to keep track of what other managers are doing or not and I could only assume and wish that they'd distribute Node as close as possible from pristine. |
My opinion (and does not necessarily represent the TSC's, or any other group I'm a part of, and is obviously not legal advice) is that Homebrew is in no "obligation" to follow the same conventions as the upstream project when it comes to distribution. As a user, I agree that aligning with Node.js defaults seems to be the least likely to cause confusion. I'm certainly not qualified to decide Node.js will, and everyone is welcome to disagree with my position. |
I appreciate your words here, couldn't have spoken better, in full agreement here. |
Hello all. I'm a member of Homebrew's Project Leadership Committee. You've also heard from @Bo98 who is on our TSC. We try to ship binaries as close to upstream as possible, as long as it makes sense for us to do so. As other maintainers have mentioned, we are operating in the same way we have for a decade or longer. We're happy to make formula changes if it helps our users, but we will not make sudden changes that may disrupt large amounts of users. We're happy to discuss with Node's maintainers if there is upstream concern, otherwise we will continue to package and ship as we always have. @ovflowd Claims of OSS license violations are something we take very seriously. Please ensure your facts are in order before opening an issue and making claims are incorrect and alarmist. @aduh95 Thank you for chiming in from the Node side. We will discuss internally on how we should handle |
There are concerns that we would like to have it shipped as close upstream as possible, which is not precisely the case right now. But at the same time, you decide to decide what to ship.
I already apologised for my unnecessary escalation here; it was wrong, excessive, and mostly done as an initially rushed and concerned act from my side. I was shocked that Homebrew was doing something differently, failing to realise this was the status quo. Still, it was factually incorrect and wrong; apologies for that. I have a terrible habit of jumping, and sometimes, I forget to think for 2 seconds about whether I should write something or not. |
Now we have |
should be good now, closing the issue. |
🎉 |
I'm a bit confused by this change. As I understand, there are plans for corepack to be separated from the Node release in favor of a standalone installation (https://github.com/nodejs/package-maintenance/pull/606/files). When that happens, will the I've been installing corepack via Homebrew in anticipation of this change, but now it's been removed. For context, I preferred using Homebrew over npm for installing corepack because I switch between multiple Node/npm versions with nvm. I wonder if it could've been possible to keep the |
We're opting for consistency among our formulae right now. When Node makes whatever changes they plan to make, we will adapt accordingly. They may involve bringing the |
I agree that including But Corepack also supports independent installation, so being consistent with that option seems important as well: https://github.com/nodejs/corepack#manual-installs Could we consider reintroducing the standalone |
following up on @carlocab 's comment about complications for users of yarn/pnpm formulae what would be the preferred resolution there because this change made the node formula incompatible with yarn/pnpm formulae yarn/pnpm formulae don't depend on the node formula (beyond build and test phases), but they do require node to be installed, which most of us, and especially because of the bundled notice, would install via |
If I may add a personal 2c on this
Following the thread, I do not understand what made the homebrew maintainers go along with this, as the net benefit from a user perspective is simply skipping "brew install corepack" (IF you actually need corepack features), while actually losing the ability to decide how to make yarn/pnpm available - via corepack or via specific homebrew formulae. |
@andreineculau Thank you for this additional info. We definitely did not intend to cause issues with yarn/pnpm. We are discussing internally and will have a path forward soon. |
FWIW on nixpkgs, there's a |
It was somewhat a request from upstream to "conform" with the expectations Node has for distributing Node. (Note that we defer the decisions of how Homebrew distributes Node to Homebrew, but at least speaking for myself, It is a desirable expectation for the formulae to be as close as possible of upstream) Corepack might or might not be removed in the future; I like the idea of a node-slim formulae, but not sure how much of a hassle it would be for Homebrew maintainers. I also can't see how corepack being installed (it is not enabled by default) would cause any issues for the yarn/pnpm formulae's 🤨 -- this was the behaviour until Node.js v20 on Homebrew, so either the issue existed before or is it a new one, or maybe particular to your system? 👀 |
Also my 2cents, I don't think it is productive to argue what Node is supposed to be or not on a thread on Homebrew core, if you believe Node is doing too much, you're more than welcome to provide feedback upstream. (Apologies if I am overreaching here) |
Can you clarify, with steps to reproduce, what broke here? The original The footprint of the original
plus everything installed by Now the footprint is:
plus everything installed by One difference I do see is the original #!/opt/homebrew/opt/node/bin/node
process.env.COREPACK_ENABLE_DOWNLOAD_PROMPT??='0';
require('./lib/corepack.cjs').runMain(process.argv.slice(2)); but the newer one has |
Bo, I have been collecting root-cause data since the last comment, and can nuance the "this change made the node formula incompatible with yarn/pnpm formulae":
Overall one can consider these edge/corner cases, but ultimately corepack's shim functionality (with no guards) coupled with poor practices (assumptions about the environment) make the pure availability of corepack a problem in itself. One could say that this (not removing corepack from the node formula, and pushing for better practices) is the right thing long term, but it could have benefitted from more consideration about implications and gains (homebrew users skipping Off-topic: the shebang discovery probably makes sense to enforce running with homebrew's node |
In terms of older formulae: this is something we can never realistically support. If you're mixing and matching packages from different points in time there's a very high chance things will break. Node dependents that don't link to anything native have it a bit easier - it would be significantly worse if you mixed things like a dylib that breaks ABI often. In terms of custom formulae, We kept the The other two scenarios make more sense and do sympathise with scripts breaking as we do try to avoid that. I do have one question about them though: how do they handle Linux distros? Homebrew's permission model is more lax but if I did
It would perhaps make some sense if Homebrew was able to similarly block Unfortunately, I'm not sure if a perfect solution exists without potentially some changes upstream but we'll try our best to try cover the majority. |
brew gist-logs <formula>
link ORbrew config
ANDbrew doctor
outputVerification
brew doctor
output saysYour system is ready to brew.
and am still able to reproduce my issue.brew update
and am still able to reproduce my issue.brew doctor
and that did not fix my problem.What were you trying to do (and why)?
I was trying to use Homebrew to install Node.js v22 and use Corepack, in the same way that I installed Node.js v20 and used Corepack
What happened (include all command output)?
Following the official Node.js download page, I used Homebrew to install
node@22
, and then tried to enable thecorepack
binary as in the Node.js docs and it is not available:This is divergent behavior from
node@20
(and other versions), where installation yields a working, installed Corepack out of the box:What did you expect to happen?
node@22
should install the Corepack binary likenode@20
does (Corepack is expected to be a part of Node.js)Step-by-step reproduction instructions (by running
brew
commands)The text was updated successfully, but these errors were encountered: