Last night i updated to macOS Mojave,
This morning I navigated to my work's code base in Command line on my MacBook pro,
typed in "git status" in the repo and received the error:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
I figured out the Xcode Command Line Tools part from the error message, but after running Xcode and getting the prompt to install the additional tools it did claim to install them, but still I got the same error after opening a new terminal.
So I did the
xcode-select --install
manually and after that it worked for me.The problem is that Xcode Command-line Tools needs to be updated.
Go back to your terminal and hit:
You'll then receive:
And be prompted in a window to update Xcode Command Line tools.
After the update is completed, open a new terminal window and your development tools should be returned.
For me
xcode-select --reset
was the solution on Mojave.I got some errors that the software was unavailable from the update server when trying
xcode-select --install
What fixed it for me was going here https://developer.apple.com/download/more/ and downloading
Command Line Tools (macOS 10.14) for Xcode 10
and then installing it manually.After that, the errors should be gone when you open up a new terminal.
For me what worked is
sudo xcode-select --reset
as is on @High6's answer above, then
sudo sudo xcodebuild -license
this will reveal a licence which I assume is some xcode licence, scroll to the bottom using
space
button then typeagree
.This is what worked for me on MacOS Mojave v 10.14
For me, I didn't have xcode installed (on Mojave OS). I went to the App Store on my mac and downloaded it, then went back to terminal and typed
git
and hit enter, then it worked.