No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'. No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'. No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'. code example

Example 1: gyp: No Xcode or CLT version detected!

sudo rm -rf $(xcode-select -print-path)
xcode-select --install

Example 2: No Xcode or CLT version detected!

xcode-select --print-path
# in my case /Library/Developer/CommandLineTools

# the next line deletes the path returned by the command above
sudo rm -rf $(xcode-select --print-path)

# install them (again) if you don't get a default installation prompt
xcode-select --install

Example 3: No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'

sudo rm -rf $(xcode-select -print-path)
Download command line tools from https://developer.apple.com/download/more/
Install it