在运行npm安装时看到以下错误,需要node-gyp…但可以被任何需要xcode-select的东西触发。
xcodebuild工具需要Xcode,但是是活动的 开发者目录'/Library/ developer /CommandLineTools'是一个命令 直线工具实例
有什么问题吗?
在运行npm安装时看到以下错误,需要node-gyp…但可以被任何需要xcode-select的东西触发。
xcodebuild工具需要Xcode,但是是活动的 开发者目录'/Library/ developer /CommandLineTools'是一个命令 直线工具实例
有什么问题吗?
当前回答
请按以下步骤操作:
最新版本的Xcode可以从https://developer.apple.com/xcode/download/下载 除非另有说明,否则将在“下载”中下载。请确保检查你下载和提取Xcode的路径 现在不像其他下载的应用程序,在提取时,Xcode没有提供将其移动到应用程序的选项 注意XCODE-ACTUAL-LOCATION或将其移动到应用程序 注意你是否下载了Xcode或Xcode-beta
在4和5的基础上,执行其中一条命令(如果没有阅读上述说明,请不要执行所有命令):
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
sudo xcode-select -s /Applications/Xcode-beta.app/Contents/Developer
sudo xcode-select -s /[XCODE-ACTUAL-LOCATION]/Xcode.app/Contents/Developer
sudo xcode-select -s /[XCODE-ACTUAL-LOCATION]/Xcode-beta.app/Contents/Developer
其他回答
只需运行sudo xcode-select -r即可自动重置路径。
-r, --reset
Unsets any user-specified developer directory, so that the developer directory will be found via the default search mechanism. This command must be
run with superuser permissions (see sudo(8)), and will affect all users on the system.
我在尝试使用npm安装包时遇到了一个问题。 我得到了错误:“sudo xcode-select -s /Applications//Xcode.app/Contents/Developer/”
要解决这个问题
我打开Xcode。 首选项 位置 选择命令林工具:Xcode 6.1.1
现在当用npm安装包时,我不再会得到错误。
如果你使用的是Xcode测试版,运行
sudo xcode-select --switch /Applications/Xcode-beta.app/Contents/Developer
而不是
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
从App Store安装Xcode。安装完成后,使用root权限运行xcodebuild,即sudo xcodebuild并接受该语言。在这个npm安装之后,bcrypt就像一个魅力!
简单的重新安装xcode-select
sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install