博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
xcode选择活动的开发人员目录错误
阅读量:2290 次
发布时间:2019-05-09

本文共 2918 字,大约阅读时间需要 9 分钟。

本文翻译自:

Saw the following error when running an npm install which required node-gyp ... but could be triggered by anything which requires xcode-select . 运行npm install ,需要node-gyp ...看到以下错误,但可能由需要xcode-select任何东西触发。

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance xcode-select:错误:工具'xcodebuild'需要Xcode,但是活动的开发人员目录'/ Library / Developer / CommandLineTools'是命令行工具实例

What is the problem? 问题是什么?


#1楼

参考:


#2楼

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) xcode-select开发人员目录指向/Library/Developer/CommandLineTools时,需要完整的常规Xcode(在Xcode之后安装/Library/Developer/CommandLineTools时发生),就会发生此问题。

Solution: 解:

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

Note: Make sure your Xcode app path is correct. 注意:确保您的Xcode应用程序路径正确。

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

#3楼

Other solution for those who don't want to install Xcode: 对于那些不想安装Xcode的人的其他解决方案:

  1. Install Command Line Tools (if you haven't already): 安装命令行工具(如果尚未安装):

    xcode-select --install

  2. Change the active directory: 更改活动目录:

    sudo xcode-select -switch /Library/Developer/CommandLineTools

This worked for me (git). 这对我有用(git)。


#4楼

Install Xcode from App Store. 从App Store安装Xcode。 After installing run xcodebuild with root privileges ie sudo xcodebuild and accept the language. 安装后,以root权限(即sudo xcodebuild运行xcodebuild并接受该语言。 After this npm install bcrypt worked like a charm! 在此npm install bcrypt就像一个魅力一样npm install bcrypt了作用!


#5楼

I was having an issue while trying to install packages using npm. 尝试使用npm安装软件包时遇到问题。 I got the error: "sudo xcode-select -s /Applications//Xcode.app/Contents/Developer/" 我收到错误:“ sudo xcode-select -s /Applications//Xcode.app/Contents/Developer/”

To fix this 要解决这个问题

  • I opened Xcode. 我打开了Xcode。
  • Preferences 首选项
  • Locations 地点
  • Selected the Command Lin Tools: Xcode 6.1.1 选择了Command Lin工具:Xcode 6.1.1

Now when installing packages with npm I no longer get errors. 现在,当使用npm安装软件包时,不再出现错误。


#6楼

Without Xcode: create file /usr/local/bin/xcodebuild with content to cheat XcodeSelect 如果没有Xcode:创建文件/usr/local/bin/xcodebuild并包含内容以欺骗XcodeSelect

#!/bin/bash  exit 0

chmod +x /usr/local/bin/xcodebuild

转载地址:http://pncnb.baihongyu.com/

你可能感兴趣的文章
poj1269——Intersecting Lines(判断线段交点)
查看>>
poj2653——Pick-up sticks(判断线段是否相交)
查看>>
poj1753——Flip Game(枚举+dfs)
查看>>
poj2965——The Pilots Brothers' refrigerator(模拟)
查看>>
poj2506——Tiling(递推+大数加)
查看>>
poj3295——Tautology(构造法)
查看>>
poj1573——Robot Motion(模拟)
查看>>
poj2485——Highways(最小生成树+prim)
查看>>
poj3083——Children of the Candy Corn(bfs)
查看>>
poj3026——Borg Maze(BFS+最小生成树)
查看>>
poj1094——Sorting It All Out(拓扑排序)
查看>>
poj1035——Spell checker
查看>>
poj3080——Blue Jeans(字串)
查看>>
poj2299——Ultra-QuickSort(归并排序)
查看>>
poj3122——Pie(二分+贪心)
查看>>
poj1936——All in All
查看>>
poj3349——Snowflake Snow Snowflakes(hash表)
查看>>
poj2418——Hardwood Species(stl+map)
查看>>
poj2488——A Knight's Journey(dfs)
查看>>
poj3087——Shuffle'm Up(BFS)
查看>>