Mac OS: xcrun: error: invalid active developer path

While watching one of the Microsoft Build 2021 sessions, I ran into the following error message while trying to clone a project from Github using the git clone command line on my Mac. The entire error message is below:

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

Thankfully, the fix for this is pretty straightforward, install the Xcode toolkit! I had done this before, but for some reason, I had to do it again, and only after doing this, my git commands started to work while executing them in the terminal.

To install the Xcode toolkit, use the following command in your Mac OS terminal:

xcode-select --install

If that doesn’t work, try the following:

sudo xcode-select --install

And if that also doesn’t work, you can try the following next:

sudo xcode-select --reset

If the command line options above don’t work for you, you can download the Xcode toolkit manually from Apple’s Developer download page.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.