I was facing the same issue
I reinstalled the command line tools.
You need to find the installation directory.
xcode-select --print-path
Delete the existing installation:
sudo rm -r -f /Library/Developer/CommandLineTools
Install by running:
xcode-select --install