Git doesn't work on MacOS Catalina: "xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing"

76,751

You'll need to reinstall the command line tools:

$ xcode-select --install
Share:
76,751

Related videos on Youtube

Admin
Author by

Admin

Updated on October 10, 2020

Comments

  • Admin
    Admin over 3 years

    After upgrading to MacOS X 10.15 Catalina, I cannot run any git commands in my shell:

    The default interactive shell is now zsh.

    To update your account to use zsh, please run chsh -s /bin/zsh.

    For more details, please visit https://support.apple.com/kb/HT208050.

    ~ | git

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

    I thought there's a problem with my shell, so I followed the instructions to change the default Mac OS shell back to bash, using the GUI and also using the command line:

    chsh -s /bin/bash
    

    I also restarted the computer. However, I still see the same message, even though echo "$SHELL" outputs /bin/bash.

  • Admin
    Admin over 4 years
    It worked! Also add export BASH_SILENCE_DEPRECATION_WARNING=1 to your ~/.bash_profile file to get rid of the annoying message.
  • idmean
    idmean over 4 years
    Learn this command by heart. It is almost always the answer to development issues after upgrading macOS.
  • Mendel
    Mendel over 4 years
    xcode-select --reset was the solution for my device.
  • David Hladky
    David Hladky over 4 years
    sudo xcode-select --reset worked. However it additionally required to agree to terms and conditions. The command was: sudo xcodebuild -license
  • vhs
    vhs over 4 years
    It may be possible to dodge the license agreement by running xcodebuild -runFirstLaunch instead of the provided command.
  • ryanpcmcquen
    ryanpcmcquen over 4 years
    You can also run sudo xcodebuild -license accept to accept it without a prompt.
  • The Vojtisek
    The Vojtisek over 4 years
    if it writes xcode-select command not found or something like that, just reboot after the OS upgrade and try run the xcode-select --install again.
  • Abhishek Aggarwal
    Abhishek Aggarwal about 4 years
    sudo xcode-select --reset worked for me without any hassle.
  • Vikram K
    Vikram K about 4 years
    sudo xcode-select --reset worked for me.
  • Guna
    Guna almost 4 years
    The install command said "Can't install the software because it is not currently available from the Software Update server". Any idea how to get pass this?
  • Dragos Stanciu
    Dragos Stanciu almost 4 years
    @Guna I manually downloaded and installed the CMD line tools from: developer.apple.com/download/more/?=command%20line%20tools I used the Xcode 12 version.
  • JunaidFarooqui
    JunaidFarooqui over 3 years
    sudo xcode-select --reset works for me.