tjm*_*hta 601 macos xcode command-line-tool npm npm-install
运行npm install
所需的node-gyp
... 时看到以下错误,但可能由任何需要的东西触发xcode-select
.
xcode-select:错误:工具'xcodebuild'需要Xcode,但是活动的开发人员目录'/ Library/Developer/CommandLineTools'是一个命令行工具实例
问题是什么?
tjm*_*hta 1143
当xcode-select
开发人员目录指向时/Library/Developer/CommandLineTools
,当需要完整的常规Xcode时(在Xcode之后安装CommandLineTools时发生)会发生此问题
解:
/Applications
目录中(NOT /Users/{user}/Applications
).xcode-select
使用以下命令指向Xcode app Developer目录:sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
注意:确保您的Xcode应用程序路径正确无误.
/Applications/Xcode.app/Contents/Developer
/Applications/Xcode-beta.app/Contents/Developer
小智 155
针对那些不想安装Xcode的人的其他解决方案:
安装命令行工具(如果还没有):
xcode-select --install
更改活动目录:
sudo xcode-select -switch /Library/Developer/CommandLineTools
这对我有用(git).
小智 139
尝试使用npm安装软件包时出现问题.我收到错误:"sudo xcode-select -s /Applications//Xcode.app/Contents/Developer/"
解决这个问题
现在用npm安装软件包时我不再出错.
chu*_*guy 47
只需运行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.
Run Code Online (Sandbox Code Playgroud)
Den*_*ger 26
在你的终端输入这个
xcode-select --install
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -license accept
Run Code Online (Sandbox Code Playgroud)
And*_*eko 10
以防您使用xcode beta:
sudo xcode-select -s /Applications/Xcode-Beta.app/Contents/Developer
Run Code Online (Sandbox Code Playgroud)
我必须先运行
sudo xcode-select --reset
Run Code Online (Sandbox Code Playgroud)
然后
sudo xcode-select -switch /Library/Developer/CommandLineTools
Run Code Online (Sandbox Code Playgroud)
然后它起作用了。
我在高山脉也遇到了同样的问题。运行以下命令解决了它
npm explore npm -g -- npm install node-gyp@latest
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
277782 次 |
最近记录: |