ChatGPT解决这个技术问题 Extra ChatGPT

Invalid active developer path error after upgrading to El Capitan

I ran into this error trying to push to git, when I typed git init.

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

I tried the following solutions.

xcode-select —install
sudo xcode-select -switch
sudo xcode-select —install
brew doctor
brew update
brew upgrade
brew cleanup
For Xcode 11.3, the following link is what needs to be downloaded. download.developer.apple.com/Developer_Tools/…

A
Arcolye

This is all you need to do:

$ xcode-select --install

Works for Sierra too
Works for High Sierra too
What does running xcode-select --install actually do / how does the license check work? I checked the md5 of one of the covered executables (in my case make) and it's the same before and after running xcode-select --install.
Works for Mojave, too!
Works for Catalina, too!
n
nikhilgohil11

You can select command line tools from the XCode Preferences shown in the screenshot below.

You will get a prompt for password.

https://i.stack.imgur.com/shCHZ.png


I moved my XCode to another ssd. After that I got the error message when trying to use git. Your solution is very quick and solved the problem!
I had 2 of the same option/version/id in this field, chose first one instead of selected second one, and it worked (I previously updated xcode from appstore as opposed to my initial manual DL installation, guess this is what messed it up after a simple react native library installation/linkage)
Yes, you are right, in your case maybe there are two command line tools and react native is looking for an installed tool which is not selected in Xcode. Btw I'm happy that you solved the issue
Happy to hear, Rene! Isn't it amazing to get reply on my 4 years old answer
M
Michael Dautermann

1)

try typing in "xcode-select -print-path" and see if the path you see is the path you're expecting for your current Xcode version.

2)

If you go to:

https://developer.apple.com/downloads/

(you'll need to sign in with your Apple Developer account)

Once there, you'll see links for "Command Line Tools". It sounds like you need to install MacOS 10.11 Command Line Tools for Xcode 7.


I had the same issue when upgrading from El Capitan to Sierra, and the solution was the same: download Sierra's version of the Command Line Tools.
Same goes for the just-released Mojave. Thanks!
Same solution for Catalina!
r
r4m

Try:

sudo xcode-select -r

in this way it unsets any user-specified developer directory, so that the developer directory will be found via the default search mechanism.


This worked for me. [above error occured after upgrading to Catalina from Mojave]
b
bb216b3acfd8f72cbc8f899d4d6963

If you have Catalina and Xcode 11 and you have this problem, then go to Xcode Preferences and select Location tab, check that the Command Line tool dropdown has Xcode 11.0 selected. If Xcode 11 is not there then you need to download and install Command-line tools for Xcode 11 here (choose the correct Beta)

https://developer.apple.com/download/more/?=command%20line%20tools


Opening Xcode, letting update some components and then making the "Command Line tool dropdown" change suggested here fixed the problem for me.