LoginSignup
2
0

More than 3 years have passed since last update.

homebrew -v するとno git repostitory と出てanyenvをインストールできなかった問題

Last updated at Posted at 2021-04-03

homebrewをインストールして、その後にanyenvをインストールしようとしたときに問題が起こったので共有します。

そもそもやろうとしていたこと

こちらの記事の内容に従ってmac(intel)にNode.jsをインストールしようとしていた。
その際、homebrewインストール後にanyenvをインストールしようとした際に問題が発生した。

homebrewのインストール

公式ページからダウンロードをした。

発生した問題

homebrew-coreの部分がno git repositoryとなってしまう。

Homebrew 3.0.10
Homebrew/homebrew-core (no git repository)
Homebrew/homebrew-cask (git revision xxxxxxx; last commit 2021-04-03)

anyenvをインストールしようとすると、できず。

$ brew install anyenv
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
Error: No available formula or cask with the name "anyenv".
==> 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 doctorで見てみた

brewの不具合はbrew doctorを実行するとわかるらしいことを知ったので、実行。

$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

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

git -C $(brew --repo homebrew/core) checkout masterを実行すると解決できそうですね。

解決

上のgit -C $(brew --repo homebrew/core) checkout masterを実行したら解決。

$ brew -v 
Homebrew 3.0.10
Homebrew/homebrew-core (git revision xxxxxx; last commit 2021-04-03)
Homebrew/homebrew-cask (git revision xxxxxx; last commit 2021-04-03)

参考サイト

2
0
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
2
0