-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NPM install fails while compiling CanvasRenderingContext2d.o #1257
Comments
btw if some can upload a prebuilt version, it would be awesome. |
I'm not a mac person and can't give too much helpful info, but that means your compiler is old. You need at least C++11 support. Hopefully that steers you in the right direction... |
Hmmm, Xcode 10 should have full support for C++11 though 🤔 |
|
Hmm, strange, I don't even have |
@david-jimenez-sp do you have GCC installed via Homebrew? |
I do not. For reference I have these installed with Homebrew. I'm not sure if that is a side effect of another library installed with Homebrew.
|
Had this happen to me today, so I decided to spend some time investigating. The common.gypi currently included with Node.js 6.x doesn't explicitly set CLANG_CXX_LIBRARY to "libc++", which causes Clang to default to a non-C++11 standard library (due to MACOSX_DEPLOYMENT_TARGET being set to "10.7", also in common.gypi). From Node.js 7.0.0 onwards, CLANG_CXX_LIBRARY is set accordingly, so this issue should be limited to Node.js 6.x on Mac OS. @david-jimenez-sp - If you try running npm install with the -d flag, you should be able to see where node-gyp is loading common.gypi from - hopefully it'll be in .node-gyp in your home directory. If it is, you should be able to patch it as below:
If that fixes it for @david-jimenez-sp , then the easiest solution would probably be to specify CLANG_CXX_LIBRARY under xcode_settings in binding.gyp. |
That did the trick. Thanks @StoneJT for figuring this out! |
Nice work. Happy to accept a PR for that if anyone wants! |
@StoneJT Thank you! |
Closing since this only affected Node.js v6.x, which node-canvas no longer supports. |
Issue
npm install
fails on a Mac OS High Sierra. The binary is not found and it falls back to compiling. Compilation fails while makingCanvasRenderingContext2d.o
Steps to Reproduce
Using brew
brew install pkg-config cairo pango libpng jpeg giflib
npm install cairo
Your Environment
The text was updated successfully, but these errors were encountered: