xcode-select active developer directory error

2019-01-02 21:17发布

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: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

What is the problem?

13条回答
疯言疯语
2楼-- · 2019-01-02 22:18
  1. Download Xcode from App Store.

  2. Go to Xcode preferences/Locations/CommandlineTools

    You just have to set it to the Xcode version. It automatically points to '/Application/Xcode.app'

查看更多
▲ chillily
3楼-- · 2019-01-02 22:18

I had two instance of Xcode installed xcode.app and xcode-beta.app When I tried to create a build with netbeans it showed me the error "supported version of xcode and command line tools not found netbeans"

I followed the following steps:

  1. "xcode-select --print-path" is equal to "/Applications/Xcode.app/Contents/Developer"
  2. "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform" exists
  3. "xcodebuild -version" starts with "Xcode"

after 1 I found that it is pointing me to xcode-beta.app

so here is the solution which worked like a charm:

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

查看更多
劳资没心,怎么记你
4楼-- · 2019-01-02 22:19

I was having an issue while trying to install packages using npm. I got the error: "sudo xcode-select -s /Applications//Xcode.app/Contents/Developer/"

To fix this

  • I opened Xcode.
  • Preferences
  • Locations
  • Selected the Command Lin Tools: Xcode 6.1.1

Now when installing packages with npm I no longer get errors.

查看更多
戒情不戒烟
5楼-- · 2019-01-02 22:19

Without Xcode: create file /usr/local/bin/xcodebuild with content to cheat XcodeSelect

  #!/bin/bash
  exit 0

chmod +x /usr/local/bin/xcodebuild

查看更多
ら.Afraid
6楼-- · 2019-01-02 22:20

Install Xcode from App Store. After installing run xcodebuild with root privileges i.e. sudo xcodebuild and accept the language. After this npm install bcrypt worked like a charm!

查看更多
7楼-- · 2019-01-02 22:22

XCode2: sudo xcode-select -s /Applications/Xcode\ 2.app/Contents/Developer

Pay attention to the "\" to escape the space

查看更多
登录 后发表回答