You are currently browsing the monthly archive for February 2020.

It seems after every MacOS update these days I get this reoccurring issue about not being able to build GYP in a node project. I got tired of looking up the references to fix it and am consolidating them here for future reference.

The Error

The error that is thrown (or close to it is):

gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (/usr/local/Cellar/node@10/10.18.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:191:23)
gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Darwin 19.3.0
gyp ER

The Fix

XCode CLTools is require for this to work. I don’t know the details, only what has corrected this for me in the past.

Check if installed:
/usr/sbin/pkgutil --packages | grep CLTools

Nothing will be returned if they are not present. If they are, ¯\_(ツ)_/¯, more research I guess.

Install XCode cli only:
xcode-select --install

If you received the error, “xcode-select: error: command line tools are already installed, use “Software Update” to install updates” you will need to remove the xtools first. Per the documentation you do that by:
sudo rm -rf /Library/Developer/CommandLineTools

Run the install again, and all should install as expected.

Once the install is complete recheck if CLTools are present:
/usr/sbin/pkgutil --packages | grep CLTools

You should received a response something like:

com.apple.pkg.CLTools_Executables
com.apple.pkg.CLTools_SDK_macOS1015
com.apple.pkg.CLTools_SDK_macOS1014
com.apple.pkg.CLTools_macOS_SDK

 

That’s it, try your build again.

Twitter Updates

Error: Twitter did not respond. Please wait a few minutes and refresh this page.

%d bloggers like this: