brew install报错오류: 설치된 개발자 도구가 없습니다. 오류: 종료 128로 명령 실패: git

  • 첫 번째 문제를 먼저 풀어보자

오류: 설치된 개발자 도구가 없습니다.
명령줄 도구 설치:
xcode-select --install
xcode-select --install
  • 그런 다음 추출을 업그레이드하면 경고가 나타납니다. 그런 다음 트리를 다시 설치하십시오.

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