【问题标题】:Git doesn't work on MacOS Catalina: "xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing" [duplicate]Git 在 MacOS Catalina 上不起作用:“xcrun:错误:无效的活动开发人员路径(/Library/Developer/CommandLineTools),缺失”[重复]
【发布时间】:2020-02-05 09:42:13
【问题描述】:

升级到 MacOS X 10.15 Catalina 后,我无法在我的 shell 中运行任何 git 命令:

默认的交互式 shell 现在是 zsh。

要更新您的帐户以使用 zsh,请运行chsh -s /bin/zsh

更多详情,请访问https://support.apple.com/kb/HT208050

~ |混帐

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

我认为我的 shell 有问题,所以我按照说明将默认的 Mac OS shell 改回 bash,使用 GUI 和命令行:

chsh -s /bin/bash

我还重新启动了计算机。但是,我仍然看到相同的消息,即使 echo "$SHELL" 输出 /bin/bash

【问题讨论】:

标签: bash git macos zsh macos-catalina


【解决方案1】:

您需要重新安装命令行工具:

$ xcode-select --install

【讨论】:

  • 成功了!还将export BASH_SILENCE_DEPRECATION_WARNING=1 添加到您的~/.bash_profile 文件中,以消除烦人的消息。
  • 背诵这个命令。升级 macOS 后几乎总是解决开发问题的方法。
  • xcode-select --reset 是我设备的解决方案。
  • sudo xcode-select --reset 有效。但是,它还需要同意条款和条件。命令是:sudo xcodebuild -license
  • 可以通过运行xcodebuild -runFirstLaunch 而不是提供的命令来规避许可协议。
猜你喜欢
  • 2020-03-03
  • 2021-11-02
  • 2021-10-27
  • 1970-01-01
  • 2020-02-07
相关资源
最近更新 更多