xcode-选择活动的开发人员目录错误 [英] xcode-select active developer directory error

查看:101
本文介绍了xcode-选择活动的开发人员目录错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在运行需要node-gypnpm install时看到以下错误,但是可能由需要xcode-select的任何东西触发.

Saw the following error when running an npm install which required node-gyp... but could be triggered by anything which requires xcode-select.

xcode-select:错误:工具'xcodebuild'需要Xcode,但处于活动状态 开发人员目录"/Library/Developer/CommandLineTools"是命令 线工具实例

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

出什么问题了?

推荐答案

xcode-select开发人员目录指向/Library/Developer/CommandLineTools,并且需要完整的常规Xcode时(发生在Xcode之后安装CommandLineTools时,会发生此问题)

This problem happens when xcode-select developer directory was pointing to /Library/Developer/CommandLineTools, when a full regular Xcode was required (happens when CommandLineTools are installed after Xcode)

解决方案:

  1. 安装Xcode(从 https://appstore.com/mac/apple/xcode)(如果您还没有的话).
  2. 接受条款和条件.
  3. 确保Xcode应用程序位于/Applications目录中(而不是/Users/{user}/Applications).
  4. 使用以下命令将xcode-select指向Xcode app Developer目录:
    sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
  1. Install Xcode (get it from https://appstore.com/mac/apple/xcode) if you don't have it yet.
  2. Accept the Terms and Conditions.
  3. Ensure Xcode app is in the /Applications directory (NOT /Users/{user}/Applications).
  4. Point xcode-select to the Xcode app Developer directory using the following command:
    sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

注意:请确保您的Xcode应用程序路径正确.

Note: Make sure your Xcode app path is correct.

  • Xcode:/Applications/Xcode.app/Contents/Developer
  • Xcode-beta:/Applications/Xcode-beta.app/Contents/Developer
  • Xcode: /Applications/Xcode.app/Contents/Developer
  • Xcode-beta: /Applications/Xcode-beta.app/Contents/Developer

这篇关于xcode-选择活动的开发人员目录错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆