WebHare community

Sass build errors "No Xcode or CLT version detected"

Since a week we’re seeing some inexplicable build errors with node-sass not properly rebuilding. npm rebuild node-sass reports

npm ERR! No receipt for ‘com.apple.pkg.CLTools_Executables’ found at ‘/’.
npm ERR!
npm ERR! No receipt for ‘com.apple.pkg.DeveloperToolsCLILeo’ found at ‘/’.
npm ERR!
npm ERR! No receipt for ‘com.apple.pkg.DeveloperToolsCLI’ found at ‘/’.
npm ERR!
npm ERR! gyp: No Xcode or CLT version detected!

If you hit this and are sure XCode is properly installed and up to date, check
xcode-select -p in a terminal. If it reports /Library/Developer/CommandLineTools try:

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

which seems to fix node-sass rebuilding. I’m not sure why this is needed and if anyone but our own machines here are affected.