在运行npm安装时看到以下错误,需要node-gyp…但可以被任何需要xcode-select的东西触发。
xcodebuild工具需要Xcode,但是是活动的 开发者目录'/Library/ developer /CommandLineTools'是一个命令 直线工具实例
有什么问题吗?
在运行npm安装时看到以下错误,需要node-gyp…但可以被任何需要xcode-select的东西触发。
xcodebuild工具需要Xcode,但是是活动的 开发者目录'/Library/ developer /CommandLineTools'是一个命令 直线工具实例
有什么问题吗?
当前回答
我得先运行这个
sudo xcode-select --reset
then
sudo xcode-select -switch /Library/Developer/CommandLineTools
然后就成功了。
其他回答
手动安装Command LineTool对我来说很有效。
我在App Store中暂停了xcode 仍然无法下载Homebrew 我通过链接手动安装命令行工具。 砰砰砰
https://developer.apple.com/download/more/?=command%20line%20tools
当需要一个完整的常规Xcode时,Xcode -select developer目录指向/Library/ developer /CommandLineTools时发生此问题(当CommandLineTools安装在Xcode之后时发生)
解决方案:
如果你还没有Xcode,请安装它(从https://appstore.com/mac/apple/xcode获取)。 接受条款和条件。 确保Xcode app在/Applications目录下(不是/Users/{user}/Applications)。 使用以下命令将Xcode -select指向Xcode app Developer目录: sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
注意:确保你的Xcode应用路径是正确的。
Xcode: / / Xcode /内容/应用开发者 Xcode-beta: / / Xcode-beta.app /内容/应用开发者
sudo xcode-select -s /Applications/Xcode 10.app/Contents/Developer
languoguangs-iMac:/ languoguang$ sudo xcode-select -s /Applications/Xcode 10.app/Contents/Developer
xcode-select: error: invalid argument '10.app/Contents/Developer'
Usage: xcode-select [options]
Print or change the path to the active developer directory. This directory
controls which tools are used for the Xcode command line tools (for example,
xcodebuild) as well as the BSD development commands (such as cc and make).
Options:
-h, --help print this help message and exit
-p, --print-path print the path of the active developer directory
-s <path>, --switch <path> set the path for the active developer directory
--install open a dialog for installation of the command line developer tools
-v, --version print the xcode-select version
-r, --reset reset to the default command line tools path
languoguangs-iMac:/ languoguang$ sudo xcode-select -s "/Applications/Xcode 10.app/Contents/Developer"
因为我在应用程序中的Xcode名称是Xcode 10,
sudo xcode-select -s "/Applications/Xcode 10.app/Contents/Developer"
的工作原理。
请按以下步骤操作:
最新版本的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
我在尝试使用npm安装包时遇到了一个问题。 我得到了错误:“sudo xcode-select -s /Applications//Xcode.app/Contents/Developer/”
要解决这个问题
我打开Xcode。 首选项 位置 选择命令林工具:Xcode 6.1.1
现在当用npm安装包时,我不再会得到错误。