xcode-选择活动的开发人员目录错误 [英] xcode-select active developer directory error
问题描述
在运行需要node-gyp
的npm install
时看到以下错误,但是可能由需要xcode-select
的任何东西触发.
Saw the following error when running an npm install
which required node-gyp
... but could be triggered by anything which requires xcode-select
.
xcode-select:错误:工具'xcodebuild'需要Xcode,但处于活动状态 开发人员目录"/Library/Developer/CommandLineTools"是命令 线工具实例
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
出什么问题了?
推荐答案
当xcode-select
开发人员目录指向/Library/Developer/CommandLineTools
,并且需要完整的常规Xcode时(发生在Xcode之后安装CommandLineTools时,会发生此问题)
This problem happens when xcode-select
developer directory was pointing to /Library/Developer/CommandLineTools
, when a full regular Xcode was required (happens when CommandLineTools are installed after Xcode)
解决方案:
- 安装Xcode(从 https://appstore.com/mac/apple/xcode)(如果您还没有的话).
- 接受条款和条件.
- 确保Xcode应用程序位于
/Applications
目录中(而不是/Users/{user}/Applications
). - 使用以下命令将
xcode-select
指向Xcode app Developer目录:
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
- Install Xcode (get it from https://appstore.com/mac/apple/xcode) if you don't have it yet.
- Accept the Terms and Conditions.
- Ensure Xcode app is in the
/Applications
directory (NOT/Users/{user}/Applications
). - Point
xcode-select
to the Xcode app Developer directory using the following command:
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
注意:请确保您的Xcode应用程序路径正确.
Note: Make sure your Xcode app path is correct.
- Xcode:
/Applications/Xcode.app/Contents/Developer
- Xcode-beta:
/Applications/Xcode-beta.app/Contents/Developer
- Xcode:
/Applications/Xcode.app/Contents/Developer
- Xcode-beta:
/Applications/Xcode-beta.app/Contents/Developer
这篇关于xcode-选择活动的开发人员目录错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!