-
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
Cannot install canvas on apple silicon #2365
Comments
Try this before, I think you miss pixman
|
Maybe this and the following comment helps. |
@neumartin The issue with this is some of those brew packages now depend on |
@EdwardMoyse |
Had the same issue (on node 21.7.1), downgrading node fixed it.
|
@fourbytes We've had luck with |
Is it the same error as I'm reporting? Because if it's |
3.12.2 |
Bingo! This seems to be the answer (or at least, a clue). Downgrading to v18.19.1 worked for me. I did some more tests using
|
For me,
|
@dy-dx That's an LLVM target triple in the form of “ARCHITECTURE-VENDOR-OPERATING_SYSTEM”. So the unknown part I believe should be “apple”, since valid triples look like “i386-apple-darwin10” (not at my Mac RN, but I'll check later what an M2 reports). |
I'm currently facing the same issue. Can we get some sort of poll going, how is everyone that's struggling installing both Python and Canvas? |
Ok. Right after I sent this I think I got it, but I'm not sure exactly how, and I'm scared to test it and break things again. This is my # The path that worked:
export PKG_CONFIG_PATH="/opt/homebrew/opt/postgresql@15/lib/pkgconfig:/opt/homebrew/Cellar/glib/2.80.0_2/lib/pkgconfig:/opt/homebrew/opt/glib/lib/pkgconfig:/opt/homebrew/cellar/pkg-config"
This is with Node 21.7.1 installed with homebrew, 3.11.8 in a conda environment, and pnpm 9.0.0-beta.1 in a TurboRepo, and on an M1 chip. I just confirmed that it works with python 3.12.2 as well, also in a conda environment. I had also tried a few different versions of Node with nvm, a couple different versions of python with both Conda and Homebrew, and the stable version of pnpm. So far, this is the only combination that worked. |
I've got the same error on my M1, I've tracked it down to the following, if you install latest canvas (2.11.2), it puts the following into your package-lock.json:
the issue is with the "nan" dependency, that has bug in it that causes the build to fail on M1 machines. I am unclear exactly where this dependency is coming from, as when checking this repo: https://github.com/Automattic/node-canvas/tree/v2.11.2 I don't see any mention of "nan", so I don't know what the fix for this repo would be, however to get it to build for time being you can override the "nan" package resolution by adding the following to your own package.json:
|
Issue or Feature
I have done:
brew install pkg-config cairo pango libpng jpeg giflib librsvg
And I have tried many, many other ways to get around this (some of which are listed here)
But I still cannot install canvas on Apple silicon. Failure is:
N.B. we don't actually have a direct dependency on canvas from phoenix, but get it from a package we use jsroot.
Steps to Reproduce
This will fail with:
(build.log is attached)
What is weird is checking out node-canvas and doing
yarn install
there seems to work... the only obvious difference I see in the log files isnode-gyp
version:Your Environment
build.log
The text was updated successfully, but these errors were encountered: