Node-Gyp on OSX

If you have Xcode installed on your Apple laptop, then you should have gotten a C++ compiler in the form of CLang.  You'd think this would work fine with Node-Gyp...and it does.  With a tweak.

Add something like this to the "targets" section of the binding.gyp file:

"xcode_settings": {

Otherwise you'll probably get a litany of errors like

"cannot use typeid with -fno-rtti"


"cannot use 'throw' with exceptions disabled"

Comments (2) Trackbacks (0)
  1. Can you do potentially drop CLang altogether and just use gcc and friends? something like,


    • The problem is Apple (and FreeBSD) dropped support for gcc and g++ in favor of Clang. You can probably get around it with Homebrew, but it doesn’t seem to be recommended by Apple or the community at large.

Leave a comment

No trackbacks yet.