Skip to content
FR
  1. LuzineDebug
  2. Systems (Windows, macOS, Linux)
  3. xcrun: error: invalid active developer path (/Li…
Systems (Windows, macOS, Linux) Beginner ≈ 10 min to fix

Fix "xcrun: error: invalid active developer path" on macOS

Error message
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
  • xcrun: error: invalid active developer path (/Applications/Xcode.app/Contents/Developer), missing xcrun at: /Applications/Xcode.app/Contents/Developer/usr/bin/xcrun
  • xcode-select: note: No developer tools were found, requesting install.
  • xcode-select: error: command line tools are already installed, use "Software Update" to install updates
  • gyp: No Xcode or CLT version detected!
In short

Apple's Command Line Tools (CLT) are missing or broken, often after a macOS update, while git, make or clang depend on them. Run xcode-select --install to reinstall them; if macOS says they are already installed, delete the /Library/Developer/CommandLineTools folder and run the install again.

Be the first to confirm this fix

What this error means

On macOS, /usr/bin/git, /usr/bin/make or /usr/bin/clang are only shims: they call xcrun, which looks for the real tool in the "active developer directory" chosen by xcode-select. That directory is either /Library/Developer/CommandLineTools or Xcode.app/Contents/Developer. If xcrun no longer exists there, all these commands fail with this message. It is typical after a major macOS update, which removes or invalidates the CLT, or after moving or deleting Xcode.

Common causes

  1. macOS update: the new version removed or invalidated the installed Command Line Tools.
  2. Xcode moved, renamed or deleted: xcode-select still points to an Xcode.app (or Xcode-beta.app) that no longer exists.
  3. Interrupted or incomplete CLT install: the folder exists but files are missing, hence the "already installed" message.

Step-by-step fix

  1. Check the active directory

    Check which folder xcode-select points to and whether xcrun is actually there.

    bash
    xcode-select -p
    ls -l /Library/Developer/CommandLineTools/usr/bin/xcrun
  2. Reinstall the Command Line Tools

    Start the install and confirm the window that opens. The download takes a few minutes. You can also use System Settings > General > Software Update if a CLT update is offered there.

    bash
    xcode-select --install
  3. If macOS says "already installed"

    Delete the CLT folder and run the install again. Copy the path exactly: this sudo rm -rf command only removes the Command Line Tools, not your projects or Homebrew.

    bash
    sudo rm -rf /Library/Developer/CommandLineTools
    xcode-select --install
  4. If you use full Xcode

    Point xcode-select to your Xcode, accept the license and finish the first-launch setup. Adjust the path if your Xcode has another name.

    bash
    sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
    sudo xcodebuild -license accept
    xcodebuild -runFirstLaunch
  5. Reset to the default path

    If you are unsure what to point to, --reset restores the default path (Xcode if installed, otherwise the CLT).

    bash
    sudo xcode-select --reset
  6. Check that everything works

    Open a new terminal and test the tools. If you use Homebrew, brew doctor reports any remaining issues.

    bash
    xcrun --version
    git --version
    clang --version
    brew doctor

Did this fix work for you?

Confirm it in one click: it will rise for the next developers stuck on the same error.

Keep it from coming back

  • After every major macOS update, run xcode-select --install or check Software Update before getting back to work.
  • Avoid renaming or moving Xcode.app; if you keep several versions, switch between them with xcode-select --switch.

Frequently asked questions

Do I need to install full Xcode?

No. For git, Homebrew, node-gyp or C/C++ compilation, the Command Line Tools are enough and much lighter. Full Xcode is only needed to build Apple apps or use the simulators.

Why did git stop working after a macOS update?

/usr/bin/git is a shim that goes through xcrun and the Command Line Tools. If the update removed them, git fails until you reinstall them.

Does reinstalling remove my Homebrew packages?

No. Homebrew packages live in /opt/homebrew (Apple Silicon) or /usr/local (Intel) and are not touched. Some compiled formulas may just need a brew reinstall.

Useful tools for this error

More Systems (Windows, macOS, Linux) errors

All Systems (Windows, macOS, Linux) errors →