This issue is usually caused because a node-gyp config file called common.gypi is not set up for your current Mac OS version.
It often times comes accompanied with an error message like:
fatal error: 'utility' file not found #include <utility>
Another usual fix is to reinstall XCode’s command-line tools with:
$ xcode-select --install
Just for context, this issue usually happens after upgrading your OS of if you use nvm and are using a newly installed NodeJs version.
If your project has any complex dependencies that rely heavily on native libraries this solution might not be for you.
If the most complex node-gyp-related dependency you have in your project is something common like node-sass then this is usually the fix you need.
You’ll need to find and edit the common.gypi file for the NodeJs version you’re using. You’ll usually find it in a path like: