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

brew install yarn --without-node no longer possible #913

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

brew install yarn --without-node no longer possible #913

rdmurphy opened this issue Jan 27, 2019 · 22 comments

Comments

@rdmurphy
Copy link

rdmurphy commented Jan 27, 2019

As of six days ago Yarn's recommended install method via Homebrew has been removed because Homebrew is doing away with options in all core formulae. (I kinda get the rationale, but, uh... yanking out the carpet from under everyone.)

Obviously there's a bigger issue here (what is the new recommended way to install Yarn on MacOS?) but currently that means what's in the docs is no longer valid. 😬

@Haroenv
Copy link
Member

Haroenv commented Jan 27, 2019

That’s unfortunate! I think in the meantime the regular fallback installation method listed on “Linux” is a good alternative. Looks like the home brew thread isn’t fully resolved for now and anyone interested in the yarn use case can chime in there. Cc @Daniel15

@Daniel15
Copy link
Member

Daniel15 commented Jan 30, 2019

I'd be happy with someone modifying the site to show the shell script above the Homebrew instructions in the MacOS installation instructions. The RC and Nightly instructions already do that, so you can just copy what they're doing (eg. see https://yarnpkg.com/en/docs/install#mac-rc)

curl -o- -L https://yarnpkg.com/install.sh | bash

@brendanfalkowski
Copy link

brendanfalkowski commented Feb 2, 2019

Literally every time I have to use brew it blows up in my face. The curl method worked for me and (hopefully) associates properly to the nvm-selected version of Node.

@fab1o
Copy link

fab1o commented Feb 5, 2019

Try: brew install yarn --ignore-dependencies

Daniel15 pushed a commit that referenced this issue Feb 6, 2019
--without-node is no longer part of the [yarn formula](https://github.com/Homebrew/homebrew-core/blob/master/Formula/yarn.rb), and node is its only dependency. Addresses #913.
@Haroenv Haroenv closed this as completed Feb 7, 2019
@brendanfalkowski
Copy link

Just for a sanity check, if I installed Yarn last week using: curl -o- -L https://yarnpkg.com/install.sh | bash

And today I ran: brew install yarn --ignore-dependencies

Do I now have two instances installed?

Running which yarn returns /Users/brendan/.yarn/bin/yarn. Should I expect to see something different from the Homebrew installation?

@rdmurphy
Copy link
Author

rdmurphy commented Feb 7, 2019

@brendanfalkowski You probably do — brew will install yarn in a different place that's standard for brew installs.

What happens when you run which -a yarn? I think you'll see both of them. (The Homebrew bin should be at /usr/local/bin/yarn.)

@brendanfalkowski
Copy link

@rdmurphy — Yup yup, that showed both. I deleted /Users/brendan/.yarn and removed this from my shell profile:

export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"

All working again with the usual PATH containing /usr/local/bin

Thanks!

@dorokei
Copy link

dorokei commented Mar 5, 2019

I ran: brew install yarn --ignore-dependencies

Installing yarn without node was successful.
But brew doctor showed below warning.

Warning: Some installed formulae are missing dependencies.
You should `brew install` the missing dependencies:
  brew install node

Run `brew missing` for more details.

I use nodebrew to manage node version. And yarn command is running normally.
Is there anyone who has same error?

@dorokei
Copy link

dorokei commented Mar 5, 2019

Sorry, I solved this warning. Create symbol link from /usr/local/Cellar/node to current node's global version.

@jonleopard
Copy link

I'm using nvm and I'm still getting the following error from brew doctor:

Warning: Some installed formulae are missing dependencies.
You should `brew install` the missing dependencies: 
  brew install node
Run `brew missing` for more details.

I found one solution here that suggested creating node directory and symlinking it to your nvm directory like so:

mkdir /usr/local/Cellar/node
ln -s ~/.nvm/versions/node/{your_node_version)/usr/local/Cellar/node

This didn't work for me. Plus, having to create a new symlink each time I want to change my node version would be sort of a pain as well. Was pretty happy with how things were working before this change.

Have any nvm users found a way to handle this dynamically?

@Loyalsoldier
Copy link

@jonleopard

Use n-install instead of nvm

@joelgetaction
Copy link

joelgetaction commented Mar 29, 2019

How do I upgrade yarn without installing dependencies? I originally installed yarn using brew install yarn --ignore-dependencies but brew upgrade does not accept the --ignore-dependencies flag and it is stubbornly insisting on installing node in brew which I do NOT want as I manage node using nvm.

Do I really need to uninstall yarn and then re-install just so I can upgrade yarn without brew forcing node on me when I don't want it? :-(

Apparently this is a known issue that was raised 2 years ago and is "not supported" by yarn? My question is "Why is it not supported?" See Homebrew/brew#2345 and I can I help to support it with a PR or similar?

@Daniel15
Copy link
Member

@joelgetaction That's a question for Homebrew. The Yarn team can't really do anything about how Homebrew is handling the Node.js dependency.

@AGutierrezR
Copy link

AGutierrezR commented Mar 30, 2019

@jonleopard

Follow @Loyalsoldier advise, n is much easier in manages node versions and you can change the version of node without affecting yarn, as long as it will be a version of node that supports yarn.

Use this link to know how.

@abumalick
Copy link

rm /usr/local/bin/node working for me

I user asdf to handle my nodejs versions

javierjulio added a commit to javierjulio/laptop that referenced this issue Apr 22, 2019
Apparently, `without-node` stopped working due to the recently reported issue:  yarnpkg/website#913 (comment) but the solution is to use what seems to be a new arg instead.
river-fish pushed a commit to ConnectedPlacesCatapult/TomboloVisualisationSuite that referenced this issue Apr 25, 2019
@gihrig
Copy link

gihrig commented May 22, 2019

I guess the yarn/homebrew folks just aren't going to fix this. :-/

Here's my solution, which worked on macOS El Capitan and Mojave:

brew remove yarn Note that you can't just brew remove node because yarn depends on it.
'brew remove node` brew does not remove node with yarn. This will not remove node installed by n.

This may be anathema to some, but...
npm i -g yarn - End of story! :-D

@bfricka
Copy link

bfricka commented May 24, 2019

@gihrig They did, but then this commit reverted the workaround documentation, so we're back to:

curl -o- -L https://yarnpkg.com/install.sh | bash

It would be useful if this were added to the docs and supported moving forward.

@gihrig
Copy link

gihrig commented May 24, 2019

@bfricka Yes, is just a simple install, something developer folks have been doing successfully for ages. I don't see why the interest in Homebrew (or Mac Ports for that matter). npm or curl do the job quickly and efficiently.

After all, isn't 'quick and efficient' the main selling point for Yarn in the first place?

The workaround, reverted in the commit you linked, was required do to changes made by Homebrew.

As mentioned above by @rdmurphy, Homebrew decided to Remove all options from Homebrew/homebrew-core formulae #31510. This seems to be the beginning of this mess. I just don't understand why the simpler (superior?) methods (npm and curl) that "just work" can't become the officially supported install methods.

For anyone interested, this issue dates back to 2016 (!), just search issues for "Homebrew". By much of the info and opinions expressed, I don't expect this issue to be resolved by the current Yarn crew.

Sad, really.

Haroenv added a commit that referenced this issue May 24, 2019
@Haroenv
Copy link
Member

Haroenv commented May 24, 2019

The website is open source, feel free to add a PR, but installing Yarn via homebrew without node is not in the homebrew philosophy, and won't be possible in any way. The regular script works just as well, and is mentioned (since now) on the Mac installation page.

@bfricka
Copy link

bfricka commented May 24, 2019

@Haroenv Great news! I definitely understand the rationale behind not using a Homebrew developer hack. If you want to use Homebrew to install Yarn, do it the Homebrew way. Thank you for addressing this in the documentation.

@dstroot
Copy link

dstroot commented Jun 27, 2019

Installing Node, NPM and Yarn via homebrew has been "more than a challenge" for some time now using homebrew. I am giving up and writing my own scripts outside of homebrew now which defeats the purpose of using my brewfile to install all my laptop's extra SW. It's incredibly frustrating that we can't have separate installers for Node, NPM and Yarn with no dependencies and those of us who use N or NVM to manage Node versions could just choose what package manager we want (NPM or Yarn) install it and move along. But no.....

@Haroenv
Copy link
Member

Haroenv commented Jun 28, 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

@yarnpkg yarnpkg locked as resolved and limited conversation to collaborators Jun 28, 2019
Kumljevx1 added a commit to Kumljevx1/yarn-website that referenced this issue Aug 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests