Ask questionsnode-gyp rebuild not working on MacOS Catalina Beta without reinstalling CommandLineTools
<details><summary>Verbose output (from npm or node-gyp):</summary>
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 '/'. gyp: No Xcode or CLT version detected!
Yes, I know, it's obvious that there are some bugs on a beta OS, but I just wanted to share the solution because I couldn't find anything by googling.
To run node-gyp, you need to do this:
xcode-select --install first, but if you already installed the command line tools in the past, this command will just output:
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
Using "Software Update" as suggested, won't fix this problem. You have to uninstall the command line tools first by deleting this folder:
After doing that, you need to run
xcode-select --install again and everything should work now.
However, even though node-gyp now finds your command line tools, it will still fail if you use a node version higher than v8.16.1, so consider downgrading to that momentarily (by using nvm for example...).
Answer questions nnmrts
@cclauss Should fix it, but I'm not sure how people that used the workaround described here would be able to reverify this, because you basically have to downgrade your command line tools, or better said "anti-upgrade" them. I think this workaround is a one-way thing, or at least a very hard to revert change.
Also, the group of users who ran and and will run into this issue is probably pretty small. My suggestion is to leave this issue open until Catalina is finally released, then close it.
EDIT: To avoid misunderstandings, I'm not saying that there are "not enough" users of neither the MacOS Beta, nor Python 3, nor node-gyp version 5.0.0 to 5.0.3. But I think being a user of all three things in this specific timeframe is pretty rare.