Open mn4367 opened 2 years ago
I checked today again: the same happens on macOS 12.4 (Monterey).
Do other users see the same behavior?
Hi, I am experiencing the same issue on macOS 12.4 (Monterey). After installing, it tries to fetch non-existing binary from https://github.com/Automattic/node-canvas/releases/download/v2.9.1/canvas-v2.9.1-node-v93-darwin-unknown-arm64.tar.gz
(same as yours). Unfortunately there is no sign of that release on the release page https://github.com/Automattic/node-canvas/releases
Because I do not have proper tools, node-gyp
fails and package is not installed properly.
Edit: Rewritten
@ihmpavel Sorry, no, it's not a shame and it's not unusable. It's open source, comes for free, works very well (provided, some dev tools are installed on an M1 machine, which is very easy to do) so I am indeed very grateful to the authors. And I doubt that it motivates the authors to look at the problem if this kind of language is used...
The only problem I have is that I can't pre-pack a version of my software with pkg
or Electron and ship that to darwin-arm64 users.
@mn4367
Unfortunately it was bad wording I used... (After translating it is a different meaning than I anticipated.) I did not want to be rude or make someone sad, angry for what are they doing for to the OSS community.
I really appreciate OSS and I am very grateful for anything that is available to use and explore. What I wanted to say, but I wrote it wrongly is: That it is pity, that there are no prebuilt binaries to use for anybody to just install, hop in, use, enjoy, help others with issues, create PR and make it better.
I know there are a lot of combinations of architectures, operating system that it is almost impossible to prebuild for all of them. (Also I know there are some architecture problems with Github actions for prebuilding all possible combinations.)
I am not familiar with building native apps on M1 (with Github Actions configuration to make them working and to be available to everyone who is using M1 or M2 macs), otherwise I have already sent a PR instead of writing comment.
I am also very happy that there are instructions for building it natively on the platform.
To sum it up I would be very happy to contribute if I understand it correctly and someone can benefit from that. (I wanted to tell you, that you are not alone on MacBook with this issue, but others are experiencing it also.)
(I have rewritten the initial comment.)
@ihmpavel, ok thanks, much better now :-)
Getting the same error. It looks like there's a release for canvas-v2.9.3-node-v102-darwin-unknown-arm64.tar.gz
, but the installer is calling canvas-v2.9.3-node-v93-darwin-unknown-arm64.tar.gz
instead which is non-existent, throwing a 404 error.
得到同样的错误。看起来有一个版本
canvas-v2.9.3-node-v102-darwin-unknown-arm64.tar.gz
,但安装程序正在调用canvas-v2.9.3-node-v93-darwin-unknown-arm64.tar.gz
它,它不存在,引发 404 错误。
https://github.com/Automattic/node-canvas/issues/1733
虽然我也遇到了同样的问题,但是我依靠它解决了,在自己 Mac 上安装了一些插件! Although I also encountered the same problem, I solved it by relying on it and installed some plugins on my Mac.
this is what fixed it for me: https://github.com/Automattic/node-canvas/issues/1733#issuecomment-761703018
canvas
brew install
like so: brew install pkg-config cairo pango libpng jpeg giflib librsvg
canvas
i'm using a docker on an M1. i ran the apt install with the correct dependency names to no avail. is it an alternate command?
Execute this in your zsh: arch -arm64 brew install pkg-config cairo pango libpng jpeg giflib librsvg
and run npm install ;)
I have found a fix for Apple M1 and M2 users! Install pre-requisites
thank you @Peter-MJ-Parker for provide the link, that helped.
For Apple M chips , the key is to install the ARM version of those package by running
arch -arm64 brew install pkg-config cairo pango libpng jpeg giflib librsvg
then you should able to just
node install canvas
https://github.com/Automattic/node-canvas/issues/2036#issuecomment-1611284426 that did it for me !
I'm trying to create a prebuild bundle of
canvas
:This is what I did:
Then I changed
./prebuild/macOS/bundle.sh
to include '-v'and invoked it. This works and
build/Release
now contains all the patched libs but if I runnpm run test
again I just get:Any ideas what is going wrong here?
otool -L
forcanvas.node
givesso this seems to be OK (from what I read the missing entries from
/usr/lib/
no longer exist physically on newer versions of macOS but are loaded from a cache).I would also like to take the opportunity to kindly ask for pre-built builds to be made available for Apple M1, thank you! I'm willing to help, but my knowledge in this area is very sparse.
Just for completeness the outputs of
./prebuild/macOS/bundle.sh
andnpm run install
are listed below../prebuild/macOS/bundle.sh
:npm run install
: