If you’re a Mac user and have updated your macOS recently, you may need to run this command in your Terminal to keep using Git commands.
I recently updated to macOS Ventura, and surprisingly when I went to Terminal and typed Git Status, I received an error. I tried Git Pull and received the same error.
Invalid Active Developer Path Terminal Error
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Fix Invalid Active Developer Path Error
Fortunately, The Onin, on Apple Stack Exchange, provides a simple answer that worked instantly for me. And he’s been updating this answer for over five years with each new Apple OS release. (Amazing!)
The issue is that now that you’re running the new macOS, you must download and install a new Command Line Tools package. To do this, in Terminal, type the following and click return:
Immediately, you’ll see the following line stating, “Install requested for command line developer tools.”
Upon successful installation, in the background, a pop-up window should open that reads, “The software was installed.”
Once this is finished, try your Git commands again. They should run with no problem. Now, Terminal is working again, so I can use the Git syncing automation I enjoy with Statamic.
I hope this fixes your Invalid Active Developer Path Terminal Error. For more information, explore the resources below.