首页 > 解决方案 > macOS Mojave:从 High Sierra 更新到 Mojave 后,活动开发者路径无效

问题描述

升级到 macOS Mojave 后,我尝试从终端运行 GIT,但它一直给我以下错误:

xcrun:错误:无效的活动开发者路径 (/Library/Developer/CommandLineTools),在 /Library/Developer/CommandLineTools/usr/bin/xcrun 处缺少 xcrun。

以前它工作正常。

标签: gitmacosmacos-mojave

解决方案


打开终端,然后运行以下命令:

xcode-select --install

这将下载并安装 xcode 开发人员工具并解决问题。问题是需要明确同意许可协议。作为后续步骤,如果您有多个版本或希望命令行工具在没有 Xcode 的情况下运行,您可能需要重置 Xcode 的路径。

xcode-select --switch /Applications/Xcode.app

xcode-select --switch /Library/Developer/CommandLineTools

我也在这个问题中找到了解决方案。

https://apple.stackexchange.com/questions/254380/macos-mojave-invalid-active-developer-path


推荐阅读