在运行npm安装时看到以下错误,需要node-gyp…但可以被任何需要xcode-select的东西触发。
xcodebuild工具需要Xcode,但是是活动的 开发者目录'/Library/ developer /CommandLineTools'是一个命令 直线工具实例
有什么问题吗?
在运行npm安装时看到以下错误,需要node-gyp…但可以被任何需要xcode-select的东西触发。
xcodebuild工具需要Xcode,但是是活动的 开发者目录'/Library/ developer /CommandLineTools'是一个命令 直线工具实例
有什么问题吗?
当前回答
XCode2: sudo Xcode -select -s /应用程序/Xcode\ 2.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"
的工作原理。
我在尝试使用npm安装包时遇到了一个问题。 我得到了错误:“sudo xcode-select -s /Applications//Xcode.app/Contents/Developer/”
要解决这个问题
我打开Xcode。 首选项 位置 选择命令林工具:Xcode 6.1.1
现在当用npm安装包时,我不再会得到错误。
XCode2: sudo Xcode -select -s /应用程序/Xcode\ 2.app/内容/开发者
注意“\”以避开空格
今天是2019年1月28日。
在我的Mac上,我做了两件事来解决这个问题:
在终端运行如下命令: Sudo xcode-select——install 重启你的Mac。
直到我重新启动电脑,我的Android Studio一直出现这个问题。重启后,它工作得很好。还要注意,我没有像其他人那样执行任何——switch命令。我希望这能有所帮助。
只需运行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.