xcode-select活动的开发者目录错误
当运行一个需要node-gyp的npm instal时,看到以下错误,但是可能被任何需要xcode-select 
xcode-select:error:工具'xcodebuild'需要Xcode,但活动开发者目录'/ Library / Developer / CommandLineTools'是一个命令行工具实例
 当xcode-select开发人员目录指向/Library/Developer/CommandLineTools ,当需要一个完整的常规XCode时发生这个问题(在XCode之后安装CLT时发生) 
解:
- 如果你还没有安装Xcode(从https://developer.apple.com/xcode/下载; )。
- 接受条款和条件。
-  确保Xcode应用程序位于/Applications目录(NOT/Users/{user}/Applications)。
-  指向xcode-select使用以下命令xcode-select到Xcode应用程序开发人员目录:
 sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
注意:确保您的Xcode应用程序path是正确的。
-   Xcode: /Applications/Xcode.app/Contents/Developer
-   Xcode-beta: /Applications/Xcode-beta.app/Contents/Developer
对于那些不想安装Xcode的其他解决scheme:
- 
安装命令行工具(如果你还没有): xcode-select --install
- 
更改活动目录: sudo xcode-select -switch /Library/Developer/CommandLineTools
这工作对我(混帐)。
我在尝试使用npm安装软件包时遇到了问题。 我得到了错误:“sudo xcode-select -s /Applications//Xcode.app/Contents/Developer/”
解决这个问题
- 我打开Xcode。
- 优先
- 地点
- select命令林工具:Xcode 6.1.1
现在用npm安装软件包时,我不会再犯错误了。
Xcode-> Preferences-> Locations->命令行工具

select选项:Xcode 8.x
以防万一您正在使用xcodetesting版:
 sudo xcode-select -s /Applications/Xcode-Beta.app/Contents/Developer 
 从App Store安装Xcode。 安装完成后,用root权限运行xcodebuild,例如sudo xcodebuild并接受语言。 在这个npm install bcrypt就像一个魅力一样工作! 
 没有Xcode:创build文件/usr/local/bin/xcodebuild与内容作弊XcodeSelect 
  #!/bin/bash exit 0 
 chmod +x /usr/local/bin/xcodebuild 
XCode2:sudo xcode-select -s / Applications / Xcode \ 2.app/Contents/Developer
注意“\”以逃避空间
我有Xcode的两个实例安装xcode.app和xcode-beta.app当我试图用NetBeans创build一个生成它显示错误“支持版本的Xcode和命令行工具未findnetbeans”
我遵循以下步骤:
- “xcode-select –print-path”等于“/Applications/Xcode.app/Contents/Developer”
- “/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform”存在
- “xcodebuild -version”以“Xcode”开头
1后我发现它是指向我xcode-beta.app
所以这里是一个像魅力一样工作的解决scheme:
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
从App Store下载Xcode。
转到Xcode首选项/位置/ CommandlineTools
你只需要将其设置为Xcode版本。 它会自动指向“/Application/Xcode.app”