Git is not working after macOS update (“xcrun: error: invalid active developer path (/Librar… | by Daniel Martin | Dec, 2024

For those who’re encountering the error.

xcrun: error: invalid energetic developer path (/Library/Developer/CommandLineTools), lacking xcrun

after updating macOS, it means the Command Line Instruments (CLT) are both lacking or must be up to date. Right here’s resolve it.

_________________________________________________________________

Run the next command to reinstall or replace the Command Line Instruments.

xcode-select --install
  • A dialog field ought to seem asking if you wish to set up the Command Line Instruments.
  • Verify and proceed with the set up.
  • As soon as the set up is full, strive your Git instructions once more.

_________________________________________________________________

If the above doesn’t work, reset the developer listing.

sudo xcode-select --reset

_________________________________________________________________

Confirm the proper path for Command Line Instruments.

xcode-select -p

This could return a path like /Library/Developer/CommandLineTools. If it does not, set it manually.

sudo xcode-select --switch /Library/Developer/CommandLineTools

_________________________________________________________________

Examine if Git is correctly put in by working.

git --version

If Git is just not put in, the system will immediate you to put in it.

_________________________________________________________________

For those who’re utilizing Xcode, guarantee it’s up to date to the newest model:

  1. Open the App Retailer.
  2. Seek for “Xcode.”
  3. Set up any accessible updates.

Alternatively, replace through the command line.

sudo softwareupdate --install -a

_________________________________________________________________

After performing the above steps, restart your Mac to make sure all adjustments take impact.

_________________________________________________________________

If the difficulty persists, set up Git straight from git-scm.com or use a bundle supervisor like Homebrew.

brew set up git

_________________________________________________________________

Sensi Tech Hub
Logo