xcrun: error: invalid active developer path fix on macOS High Sierra

After upgrading to macOS High Sierra on my MacBook Pro yesterday, I noticed that GitHub command line tools stopped working and an error came up when I tried to clone a GitHub repository. Here is the error that was presented to me:

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

If you are facing the same issue, then the fix is simple. Follow these steps in order to fix this issue:

  • Download Command Line Tools

First of all, visit the download page of Command Line Tools and download Command Line Tools for Xcode. As of now, the latest version, that worked for me as well, is 9.2. You can attempt to download the DMG file from this link as well. If this link works, then you don’t need to visit the official page and use the downloaded installer. Once the DMG file is downloaded, run the installer.

  • Reset Xcode Command Line Tools

Once the installation completes, launch your terminal and run this command:

sudo xcode-select --reset

That’s it. Now the issue should have been fixed. Please remember that these instructions address the issues resulted due to the upgrade. If Command Line Tools weren’t installed ever, then you will have to install all the tools by running this command:

xcode-select --install

I hope this fixes the issue for you as well like it did for me.

 

Rehmat

A web developer, server administrator and a blogger from Gilgit-Baltistan, Pakistan.

Post A Reply