Mac에서 xcrun: 오류: invalid active 개발자 경로 문제 해결 방법

인용: Mac 시스템에서git를 실행할 때의 오류 문제 해결 방법

문제의 기원


mac에서 github의 항목을 다운로드해야 합니다.
git clone xxx
근데 오류 메시지가 나왔어요.오류 정보는 다음과 같습니다.
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

문제 분석


초보적인 의심은 git의 문제이기 때문에 git의 도움말 정보를 보십시오.
git -h
결과는 여전히 유사한 오류 정보를 보고합니다.
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

git가 제대로 설치되어 있는지 확인하십시오.
which git /usr/bin/git
알림git가 정확하게 설치되었습니다.

문제 재분석


git의 설치 패키지가 파괴되었습니까?그래서 다시 설치하려고 합니다.
brew install git
결과는 다음과 같은 오류 정보를 제공합니다.
Error: The following formula:
  git
cannot be installed as a binary package and must be built from source.
Install the Command Line Tools:
  xcode-select --install

Error: Git must be installed and in your PATH!
Error: The following formula:
  git
cannot be installed as a binary package and must be built from source.
Install the Command Line Tools:
  xcode-select --install

놀랍게도 brew가 다음과 같은 정보를 제시했습니다. xcode-select를 다시 설치해야 합니다.그래서 xcode-select 설치 명령을 실행합니다.
xcode-select –install

결과


xcode-select 명령이 설치된 후에 명령에서 git 명령의 도움말 정보를 검사합니다.
git -h
상응하는 도움말 정보를 정확하게 출력할 수 있다는 것은git가 복구되었다는 것을 의미한다.

좋은 웹페이지 즐겨찾기