npm 工具“xcodebuild”需要Xcode,但活动开发人员目录“/Library/Developer/CommandLineTools”是命令行工具示例

eiee3dmh  于 2023-10-19  发布在  其他
关注(0)|答案(5)|浏览(176)

这是一个非常重复的xcode-select active developer directory error除了没有这些解决方案为我工作。

  1. $ sudo xcode-select --reset
  2. $ sudo xcodebuild -license accept
  3. xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
  4. $ sudo xcode-select --install
  5. xcode-select: error: command line tools are already installed, use "Software Update" to install updates

我的机器上甚至没有xcode。

mctunoxg

mctunoxg1#

这里我的修复是我的[ XCode >首选项>位置>命令行工具]选项卡是空的。不知道为什么。但在点击它并选择唯一可用的选项后,我的“* 活动开发人员目录 *”错误终于消失了。
Mac OS 12.3.1|日期:2022年5月4日

rkttyhzu

rkttyhzu2#

我遇到这个问题是因为Xcode安装在我的用户应用程序目录(~/Applications)而不是/Applications。从上面的Github链接中发现我需要运行:

  1. sudo xcode-select -s ~/Applications/Xcode.app/Contents/Developer

(note波浪号)。在这之后,一切都工作了。

ckx4rj1h

ckx4rj1h3#

如果你正在寻找一个简单的命令来解决这个问题,并且你的xcode安装在默认位置(/Applications/Xcode.app),你可以用这个命令来解决这个问题:

  1. sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
mu0hgdu0

mu0hgdu04#

在安装Xcode beta时,我也遇到了“xcode-select active developer directory error”。在你的情况下,你甚至不需要完整的Xcode,命令行工具应该可以正常工作。阅读此Github issue

2nc8po8w

2nc8po8w5#

这个错误完全矛盾的是,设置路径到/Library/Developer/CommandLineTools是最新的XCode/MacOS组合无法找到命令行工具命令下的命令行工具命令与默认路径设置。

相关问题