mac下xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools)问题

起源:git clone ***

报错:xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

 

尝试1:git h

报错:xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

 

尝试2:which git

返回:/usr/bin/git

 

尝试3: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

 

尝试4:xcode-select --install

同意安装,返回:xcode-select: note: install requested for command line developer tools

 

尝试5:git -h

返回:

unknown option: -h

usage: git [--version] [--help] [-C ] [-c =]

           [--exec-path[=]] [--html-path] [--man-path] [--info-path]

           [-p | --paginate | --no-pager] [--no-replace-objects] [--bare]

           [--git-dir=] [--work-tree=] [--namespace=]

           []

 

你可能感兴趣的:(mac下xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools)问题)