温馨提示:本文翻译自stackoverflow.com,查看原文请点击:xcode - Git is not working after macOS Update (xcrun: error: invalid active developer path (/Library/Develop
command-line git macos xcode terminal

xcode - macOS更新后Git无法正常运行(xcrun:错误:无效的活动开发人员路径(/ Library / Develop

发布于 2020-03-27 11:58:28

我已更新到macOS Mojave(这也发生在Catalina更新中)。

今天早上,我在MacBook Pro上的命令行中导航到工作的代码库,在存储库中输入“ git status”,并收到错误消息:

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

查看更多

查看更多

提问者
dustbuster
被浏览
229
dustbuster 2019-11-20 23:35

问题是Xcode命令行工具需要更新。

返回您的终端并点击:

xcode-select --install

然后,您将收到:

xcode-select: note: install requested for command line developer tools

此时将在窗口中提示您更新Xcode命令行工具。(可能需要一段时间)

打开一个新的终端窗口,应该返回您的开发工具。

另外:使用任何主要或半主要更新,您都需要更新命令行工具,以使它们再次正常运行。检查Xcode是否有任何更新。这超越了莫哈韦沙漠...

之后,重启终端