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が返るとき