Installing Node.js explicitly should link it. Installing sth that depends on it should not. #6816
Replies: 3 comments 5 replies
-
|
|
Beta Was this translation helpful? Give feedback.
-
|
I don't think that is correct. Here is what I see: brew install svgo
brew unlink node
node # command not found
svgo # worksAnd also ❯ head -n1 /opt/homebrew/bin/svgo
#!/opt/homebrew/opt/node/bin/nodeMaybe I am using the word "linking" wrong. But performing |
Beta Was this translation helpful? Give feedback.
-
|
Why would anyone install something, see that node got installed in the process, and be happy that I don't really understand the use case here. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
tl;dr Homebrew should only put items in PATH directly as a result of running
brew installfor that named package.Output of
brew configOutput of
brew doctorDescription of issue
The current behavior of brew is that when I install, for example, the svgo package it will put svgo AND node into my $PATH.
This is surprising to me because I requested
brew install svgoand I didn't runbrew install node.The fact that svgo depends on node is an implementation detail that I do not care about. And it is not permanent! It is very possible that svgo may replace its node dependency with rust or something in the future. Under the current behavior of brew, this would remove node from my $PATH.
My preferred behavior is that
brew installresults in only the named package binaries installing to my $PATH. (Homebrew would implement this by skipping the linking step of for dependencies.) This will be more predictable behavior. I recommend that the default will switch to this setting.Here is a discussion for others interested in exploring this. Here is are use case examples.
Use case
Preferred
Actual
Second use case
Preferred outcome
Actual outcome
Beta Was this translation helpful? Give feedback.
All reactions