I just upgraded from Yosemite to El Capitan (and replicated the problem upgrading from El Capitan to Sierra), and when I try to type for example git status
inside a terminal, I get the following error:
xcrun: error: invalid active developer path
(/Library/Developer/CommandLineTools), missing xcrun at:
/Library/Developer/CommandLineTools/usr/bin/xcrun
I don't have Xcode installed, never did. Anyone have a solution?
Reassigning the path Xcode is configured with worked for me.
sudo xcode-select -switch /Applications/Xcode.app
You'll then likely be prompted (after trying a command) to agree to the license agreement.
For the most recent version Mojave version 10.14.1, I use
solved by downloaded from https://developer.apple.com/download/more/ " login by apple id, and download
That makes everything work
the old answer
doesn't work for me.
For those also having issues with
heroku
command line tools after upgrading, I also had to do the following in my terminal:It seems the upgrade to High Sierra messed with my symlinks in addition to forcing me to reinstall xcode tools. I kept getting 'not a directory' errors:
Hope that saves someone an hour :)
Found the fix for the problem here.
This will bring up a prompt to install the necessary command line tools.
If you have issues with the
xcode-select --install
command; e.g. I kept getting a network problem timeout, then try downloading the dmg at developer.apple.com/downloads (Command line tools OS X 10.11) for Xcode 7.1Updated to High Sierra 10.13.2
xcode-select --install ALONE did not work for me.
$xcode-select --install
a. May need to update after install using softwareupdate in command line. $sudo softwareupdate -i "Command Line Tools (macOS High Sierra version 10.13) for Xcode-9.1"
$sudo xcodebuild -license