升级macOS后出现xcrun: error: invalid active developer path, missing xcru问题

841 阅读1分钟

当我从mojave升级到catalina后,在终端使用git命令后出现一下问题

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

解决办法:

xcode-select --install

在终端运行该命令之后,系统会自动安装Command Line Tools,稍等片刻,然后再在终端中输入git命令后,若出现以下代码,则问题解决。

 ~  git 

usage: git [--version] [--help] [-C ] [-c =] [--exec-path[=]] [--html-path] [--man-path] [--info-path] [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare] [--git-dir=] [--work-tree=] [--namespace=] [] These are common Git commands used in various situations: