gyp no xcode or clt version detected

On a fresh update of MacOS, an error may occur:

1
2
gyp: No Xcode or CLT version detected!  
gyp ERR! configure error

Solution 1: Reset xcode

Try simply running the following command:

1
sudo xcode-select --reset

Solution 2: Reinstall xcode

If the prior solution does not work, a complete reinstall of xcode may be necessary.

  1. Find the xcode path:
1
xcode-select --print-path
  1. Delete the xcode directory
1
sudo rm -rf <result from last command>
  1. Install xcode
1
xcode-select --install