I have MacOS Montery 12.3.1 and I have already installed Xcode and installed CommandLineTools long time ago. I have Xcode-select version:
xcode-select version 2395.
Now, while trying to install heroku cli I got the error:
Error: Xcode alone is not sufficient on Monterey.
Install the Command Line Tools: xcode-select --install
But the command:
xcode-select --install
the installation now would last 89 hours and it tries to download 15GB which can't be right...
sudo xcode-select --switch /Applications/Xcode.app
sudo xcode-select --switch /Library/Developer/CommandLineTools
I tried this but the second command throws the error:
xcode-select: error: invalid developer directory '/Library/Developer/CommandLineTools'
the folder CommandLineTools is in that directory... I am clueless. Thank you for your help.
The solution that worked for me was to deinstall Xcode(and everything related) and Homebrew. After reinstalling Xcode the CommandLineTools got installed with Homebrew and are working fine again.