brew install エラー: 開発者ツールがインストールされていません。エラー: コマンドが終了 128 で失敗しました: git

  • まずは最初の問題を解いてみましょう

エラー: 開発者ツールがインストールされていません。
コマンド ライン ツールをインストールします:
xcode-select --install
xcode-select --install
  • 次にbrewをアップグレードすると、警告が表示されます。次に、ツリーを再度インストールしてみてください

brew update
brew install tree
  • 次のエラーが発生します。

致命的: git ディレクトリにありません
エラー: コマンドは終了 128 で失敗しました: git
  • ターミナルに入力

brew -v
Homebrew 3.6.20
fatal: detected dubious ownership in repository at '/opt/homebrew/Library/Taps/homebrew/homebrew-core'
To add an exception for this directory, call:
git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-core
Homebrew/homebrew-core (no Git repository)
fatal: detected dubious ownership in repository at '/opt/homebrew/Library/Taps/homebrew/homebrew-cask'
To add an exception for this directory, call:
git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-cask
Homebrew/homebrew-cask (no Git repository)
  • 按照他给出的解决方法输入如下命令

git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-core

git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-cask
  • 虽然有警告,但是brew install tree成功了

おすすめ

転載: blog.csdn.net/qyqyqyi/article/details/128822779