DEV Community

o9uz.dev
o9uz.dev

Posted on • Originally published at o9uz.dev

How to fix "macOS: xcrun: error: invalid active developer path, missing xcrun" error?

macos-xcrun-error-invalid-active-developer-path-missing-xcrun

I ran into this error when I tried any brew operation (like brew update and brew upgrade) on a Mac. I had just upgraded to macOS Big Sur 11.1 and suddenly brew broke!

$ brew update

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

The fix, luckily, is pretty straight forward. Install the Xcode toolkit! Even if you had it installed before, you might have to re-register it or update it to the latest version.

$ xcode-select --install
Enter fullscreen mode Exit fullscreen mode

If that doesn’t work, force it to reset. You’ll need sudo access for this one.

$ sudo xcode-select --reset
Enter fullscreen mode Exit fullscreen mode

If even that fails, go to the Apple developer download section and download Xcode manually.

Top comments (2)

Collapse
 
arumoy profile image
Arumoy Chakraborty • Edited

I installed the CLT in user space (admin restriction from employer). Now command line works fine with $DEVELOPER_DIR set to ~/Library/Developer/CommandLineTools but homebrew can't update python weirdly.

Collapse
 
jairaencio profile image
Jaira Encio

This is gonna be my last time updating mac OS, never again!