Skip to content
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

Homebrew option --ignore-dependencies is unsupported #941

Closed
klanchman opened this issue Apr 2, 2019 · 8 comments
Closed

Homebrew option --ignore-dependencies is unsupported #941

klanchman opened this issue Apr 2, 2019 · 8 comments

Comments

@klanchman
Copy link
Contributor

The Yarn documentation says to install Yarn via Homebrew like so:

brew install yarn --ignore-dependencies

It looks like this stemmed from #913 / #916.

I found that when using brew upgrade later on, dependencies for yarn were not ignored, causing node to be installed via Homebrew. I opened an issue with Homebrew about this (Homebrew/brew#5967), and found that the --ignore-dependencies was meant to be used by Homebrew developers only, and is not a supported flag.

Homebrew has updated their documentation to point this out (Homebrew/brew#5970), so the Yarn documentation should probably not instruct users to use this flag anymore.

I'm not sure what the documentation should say instead, though. At least in my case, having nvm and Node via Homebrew doesn't cause errors anymore, I just have an extra copy of Node installed that will never be used.

@Haroenv
Copy link
Member

Haroenv commented Apr 3, 2019

🤔 I guess that's the best solution for now then. Do you want to create a PR to list the fact that you can no longer ignore node in the homebrew instructions?

@klanchman
Copy link
Contributor Author

Yep, I can open a PR 👍

I saw some discussion in #913 about possibly including the shell script install method as an alternative. Do you think that's worth adding, or just stick with a note about not having a way to ignore the node dependency via Homebrew?

@Haroenv
Copy link
Member

Haroenv commented Apr 3, 2019

Yes, I think the shell installation is the only way I can think of (that I use myself too) to properly avoid node, so it should be listed as an alternitive

@MikeMcQuaid
Copy link

@Haroenv 👋 it'd be good on the Homebrew side to figure out how us installing node can avoid being a problem. Otherwise if we ever get to a state in future where e.g. Apple bundles node with macOS these problems are going to be unavoidable for everyone.

@Haroenv
Copy link
Member

Haroenv commented Apr 3, 2019

That's a very good point, but I'm not too sure what the solution is. Installing it with homebrew (as a duplicate) can easily cause problems with e.g. nvm. How do other packages deal with this?

@MikeMcQuaid
Copy link

@Haroenv Adjusting your PATH so nvm's shims are ahead of node in the PATH avoids this issue.

@Haroenv
Copy link
Member

Haroenv commented Apr 3, 2019

Then I suggest changing that text to:

If you use nvm or similar, you have to make sure that your PATH lists the node shims made there are listed before the node version installed by Homebrew

Without code sample

@klanchman
Copy link
Contributor Author

Adjusting your PATH so nvm's shims are ahead of node in the PATH avoids this issue.

That would avoid some issues, but prior to nvm v0.34.0 having another node installed would cause errors in certain environments, like VS Code. (Refer to my comment in the issue I opened on Homebrew)

nvm no longer has this issue if you upgrade it, but I don't know if there are other Node version managers out there that might run into similar issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants