6
3

More than 3 years have passed since last update.

Homebrew/homebrew-core (no Git repository) だったときの対処方法

Posted at
brew install yarn

下記エラーが発生。

==> Searching for similarly named formulae...
Error: No similarly named formulae found.
Error: No available formula or cask with the name "yarn".
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching taps on GitHub...
Error: No formulae found in taps.
#下記コマンドで確認
brew --version

#実行結果
Homebrew 3.0.10
Homebrew/homebrew-core (no Git repository)
Homebrew/homebrew-cask (git revision d6edaf4247; last commit 2021-04-02)

Homebrew/homebrew-core (no Git repository)この一文が気になる。

ということで、下記を実行。

brew doctor

#実行結果
~省略~
Warning: Some taps are not on the default git origin branch and may not receive
updates. If this is a surprise to you, check out the default branch with:
  git -C $(brew --repo homebrew/core) checkout master
~省略~

brew doctorはhomebrewの問題をチェックするためのコマンドです。

Warningが出たので、この通りコマンドを実行してみます。

git -C $(brew --repo homebrew/core) checkout master

#実行結果
Branch 'master' set up to track remote branch 'master' from 'origin'.
Already on 'master'

これでもう一度yarnをインストールしてみる。

brew install yarn

#実行結果
🍺  /usr/local/Cellar/node/15.13.0: 3,273 files, 55.6MB
==> Installing yarn

インストールできました。めでたしめでたし。

このときはgoogleで「No previously deleted formula found.」と検索した時にヒットした下記記事が参考になった。
brew installでError: No available formulaが返るとき

6
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
3