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

Yarn formula has no --without-node option #6946

Closed
vasimi opened this issue Jan 22, 2019 · 27 comments
Closed

Yarn formula has no --without-node option #6946

vasimi opened this issue Jan 22, 2019 · 27 comments
Assignees
Labels

Comments

@vasimi
Copy link

vasimi commented Jan 22, 2019

Do you want to request a feature or report a bug?
bug

What is the current behavior?
brew ignores the --without-node option and installs node

If the current behavior is a bug, please provide the steps to reproduce.
just install yarn with homebrew with --without-node option

What is the expected behavior?
nodejs should not be installed

Please mention your node.js, yarn and operating system version.
node 10.15.0, yarn 1.13.0, macos 10.14.2

@ghost ghost assigned torifat Jan 22, 2019
@ghost ghost added the triaged label Jan 22, 2019
@ClementParis016
Copy link

Seeing this as well, looks like the Homebrew formula has been updated recently: Homebrew/homebrew-core@a34c721

@vasimi
Copy link
Author

vasimi commented Jan 22, 2019

I see, they decided to remove all options from core formulae. Homebrew/homebrew-core#31510

But I don't think it was good decision in case of yarn, because it totally breaks compatibility with nvm (you have to force uninstall node after you install yarn).

@ivancuric
Copy link

What's a good fallback? Installing via NPM for the time being?

@vasimi
Copy link
Author

vasimi commented Jan 23, 2019

@ivancuric Installing yarn through brew and force removing node. Or using macports.

@mlbrgl
Copy link

mlbrgl commented Jan 23, 2019

Seeing this too, had to brew uninstall --ignore-dependencies node as suggested, after brew install yarn --without-node.

@moneymikeMD
Copy link

yeah, I installed from the previous version with: brew install --without-node https://raw.githubusercontent.com/Homebrew/homebrew-core/29d769c6d4a0251992ce6017c89a7f7f7c45506f/Formula/yarn.rb

@arcanis
Copy link
Member

arcanis commented Jan 24, 2019

Ping @Daniel15 ?

@arcanis
Copy link
Member

arcanis commented Jan 24, 2019

Hm actually not sure we can do much about it, right? 😕

@rdmurphy
Copy link

Just hit this too. 😞 What's even worse is that it doesn't even throw an error or warning up, it just installs Node and keeps going.

I flagged it on the yarnpkg/website side: yarnpkg/website#913

@wkoffel
Copy link

wkoffel commented Jan 28, 2019

Weighing in to watch this issue. I went ahead and let it install node, and just making sure that NVM binaries are first in my path, per the recommendation in my commit comment here.

@Daniel15
Copy link
Member

Yeah I'm not sure if we can do anything here if it's a change in Homebrew itself.

If you can't use Homebrew because of this, I'd recommend installing Yarn using the shell script. It's in the "alternatives" section in the installation instructions.

@Daniel15
Copy link
Member

Could we have two formulae? One that installs Yarn and Node (like what exists today), and one that installs Yarn without Node? Seems a bit messy though.

Otherwise, I think we could have our own separate Homebrew repo for the Yarn formula, rather than including it in their core formulae. I don't know much about Homebrew, but I think you can do that using "taps".

@christian-x7h
Copy link

I think @Daniel15 's suggestion is on the right path. It seems from the discussion thread that the way forward for these use cases will be to setup a new Homebrew tap/formula.

@Daniel15
Copy link
Member

Daniel15 commented Jan 30, 2019

If someone wants to help us create a Homebrew "tap" to handle this, it would be great to add it to the releases repo: https://github.com/yarnpkg/releases

The Homebrew team appear to be locking any conversations about this change, disallowing people from even talking about it in their repos and forum:

So I think we'll either need to create our own tap (help appreciated!), or update the site to list the installation shell script as preferred over Homebrew for people that use nvm.

Yarn is the fifth most popular package on Homebrew (ref https://formulae.brew.sh/analytics/install-on-request/365d/) yet they didn't inform us of this change at all.

@Daniel15
Copy link
Member

Another data point: Around 16.7% of people that installed Yarn through Homebrew over the past year used the --without-node flag, as per their own data: https://formulae.brew.sh/formula/yarn

@joelpierre
Copy link

I got mine working by ignoring dependencies. This might bite me in the ass but everything is working as should be:

brew install yarn --ignore-dependencies

@rypit
Copy link

rypit commented Feb 5, 2019

If an nvm/nodenv based node is ahead of homebrew's node in $PATH, does yarn pick up on that?

@rdmurphy
Copy link

rdmurphy commented Feb 5, 2019

@rypit I think it'll pick it up for the purposes of yarn being used (believe it just looks for the first node in the $PATH as you mention), but the Homebrew installation doesn't attempt to check for that.

(For good-ish reasons — the theory is that the install method should be guaranteed to work and easy to test on Homebrew's end, so now it just defaults to installing Node just in case.)

@Haroenv
Copy link
Member

Haroenv commented Feb 7, 2019

The correct solution would be brew install yarn --ignore-dependencies, and that's what we wrote in the updated documentation too.

@rypit, Yarn picks up node in path when you're using e.g. nvm

@Haroenv Haroenv closed this as completed Feb 7, 2019
contolini added a commit to cfpb/consumerfinance.gov that referenced this issue Feb 15, 2019
Homebrew formulae no longer support custom options so `--without-node`
no longer works. `--ignore-dependencies` is now the recommended way
to install yarn.

yarnpkg/yarn#6946
contolini added a commit to cfpb/consumerfinance.gov that referenced this issue Feb 15, 2019
Homebrew formulae no longer support custom options so `--without-node`
no longer works. `--ignore-dependencies` is now the recommended way
to install yarn.

yarnpkg/yarn#6946
@PandaWood
Copy link

PandaWood commented Mar 2, 2019

How do we upgrade yarn that has been installed without dependencies - without installing node as a dependency?
brew upgrade yarn is now installing node for me, when it was installed without it - and neither --ignore-dependencies nor --without-node are recognized

@Haroenv
Copy link
Member

Haroenv commented Mar 4, 2019

I'd expect this might be a mismatch because of the older version and update not having this flag? Something to take up with the brew team, but I assume it would be removing the existing yarn and installing from scratch with the flag @PandaWood

@gihrig
Copy link

gihrig commented May 22, 2019

This problem seems to be a 'hot potato' tossed back and forth between yarn and homebrew.

I have successfully bypassed the whole mess with:

npm i -g yarn Works for me.

@Daniel15
Copy link
Member

This problem seems to be a 'hot potato' tossed back and forth between yarn and homebrew.

The Yarn team can't change Homebrew's behaviour. You can use an alternate installation mechanism (like the installation script) if you'd like to avoid using Homebrew.

@ivancuric
Copy link

I really don't get why npm install is not the recommended option

@tomholford
Copy link

Having installed previously without dependencies, this worked for me:

brew uninstall yarn
brew install yarn --ignore-dependencies

Works with node installed via nvm

@jbburf
Copy link

jbburf commented Jun 24, 2019

I just brought another Macbook Pro up to date and I ran into this, after reading through the above and using brew uninstall yarn brew install yarn --ignore-dependencies

I'm still unable to run yarn successfully. I have also tried a full uninstall of Homebrew, this does not fix the issue.

When I run with the --ignore-dependencies flag I get the following message:

Warning: --ignore-dependencies is an unsupported Homebrew developer flag!

@yarnpkg yarnpkg locked as resolved and limited conversation to collaborators Jun 24, 2019
@Haroenv
Copy link
Member

Haroenv commented Jun 24, 2019

there's no way to install via Homebrew without also installing Node. this is a limitation of Homebrew itself and can not be solved by us.

Your options are:

  1. use the script: https://yarnpkg.com/en/docs/install#mac-stable
curl -o- -L https://yarnpkg.com/install.sh | bash
  1. use npm

https://yarnpkg.com/en/docs/install#alternatives-stable

  1. arguing about this with Homebrew maintainers

This has already been done countless times, all linked throughout this thread

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

No branches or pull requests