If you do not have Xcode installed, download and install it from App Store and run it once to complete its setup
First, check that you have Xcode installed, if yes
Point xcode-select to the Xcode app Developer directory
using the following command:
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer