Skip to content
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

No prebuilt found for arm64 #1662

Open
johnweland opened this issue Sep 4, 2020 · 14 comments
Open

No prebuilt found for arm64 #1662

johnweland opened this issue Sep 4, 2020 · 14 comments

Comments

@johnweland
Copy link

Issue or Feature

There seems to be a missing arm64 build of canvas, build from source fails on arm64 as well.

Steps to Reproduce

npm install 
npm install --build-from-source

Your Environment

  • Version of node-canvas: 2.6.1;
  • Environment: node 14.9.0; Ubuntu 20.04 (Raspberry Pi 4);

Logs

when attempting to build directly on my Pi4

> canvas@2.6.1 install /home/jweland/apps/discordbot/node_modules/canvas
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using needle for node-pre-gyp https download 
node-pre-gyp WARN Tried to download(404): https://github.com/node-gfx/node-canvas-prebuilt/releases/download/v2.6.1/canvas-v2.6.1-node-v83-linux-glibc-arm64.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for canvas@2.6.1 and node@14.9.0 (node-v83 ABI, glibc) (falling back to source compile with node-gyp) 
/bin/sh: 1: pkg-config: not found
gyp: Call to 'pkg-config pixman-1 --libs' returned exit status 127 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Linux 5.4.0-1016-raspi
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/home/jweland/apps/discordbot/node_modules/canvas/build/Release/canvas.node" "--module_name=canvas" "--module_path=/home/jweland/apps/discordbot/node_modules/canvas/build/Release" "--napi_version=6" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v83"
gyp ERR! cwd /home/jweland/apps/discordbot/node_modules/canvas
gyp ERR! node -v v14.9.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/jweland/apps/discordbot/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/home/jweland/apps/discordbot/node_modules/canvas/build/Release --napi_version=6 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/jweland/apps/discordbot/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1047:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
node-pre-gyp ERR! System Linux 5.4.0-1016-raspi
node-pre-gyp ERR! command "/usr/bin/node" "/home/jweland/apps/discordbot/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/jweland/apps/discordbot/node_modules/canvas
node-pre-gyp ERR! node -v v14.9.0
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! not ok 
Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/jweland/apps/discordbot/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/home/jweland/apps/discordbot/node_modules/canvas/build/Release --napi_version=6 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
npm WARN discord.js-commando@0.11.0-dev requires a peer of @types/better-sqlite3@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js-commando@0.11.0-dev requires a peer of better-sqlite3@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js-commando@0.11.0-dev requires a peer of sqlite@^3.0.0 but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! canvas@2.6.1 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the canvas@2.6.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/jweland/.npm/_logs/2020-09-04T19_08_35_668Z-debug.log

When attempting --build-from-source

> canvas@2.6.1 install /home/jweland/apps/discordbot/node_modules/canvas
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using needle for node-pre-gyp https download 
/bin/sh: 1: pkg-config: not found
gyp: Call to 'pkg-config pixman-1 --libs' returned exit status 127 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Linux 5.4.0-1016-raspi
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/home/jweland/apps/discordbot/node_modules/canvas/build/Release/canvas.node" "--module_name=canvas" "--module_path=/home/jweland/apps/discordbot/node_modules/canvas/build/Release" "--napi_version=6" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v83"
gyp ERR! cwd /home/jweland/apps/discordbot/node_modules/canvas
gyp ERR! node -v v14.9.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/jweland/apps/discordbot/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/home/jweland/apps/discordbot/node_modules/canvas/build/Release --napi_version=6 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/jweland/apps/discordbot/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1047:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
node-pre-gyp ERR! System Linux 5.4.0-1016-raspi
node-pre-gyp ERR! command "/usr/bin/node" "/home/jweland/apps/discordbot/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/jweland/apps/discordbot/node_modules/canvas
node-pre-gyp ERR! node -v v14.9.0
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! not ok 
Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/jweland/apps/discordbot/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/home/jweland/apps/discordbot/node_modules/canvas/build/Release --napi_version=6 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
npm WARN commando-mongodb@1.0.3 requires a peer of discord.js-commando@^0.10.0 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js-commando@0.11.0-dev requires a peer of @types/better-sqlite3@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js-commando@0.11.0-dev requires a peer of better-sqlite3@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js-commando@0.11.0-dev requires a peer of sqlite@^3.0.0 but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! canvas@2.6.1 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the canvas@2.6.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/jweland/.npm/_logs/2020-09-04T19_11_05_625Z-debug.log

Works fine on AMD64 architecture just not ARM64.

@StefanoCastro
Copy link

Leaving a dot here as I'm in the same boat currently.
Looking forward to an ARM64 build.

@PiSaucer
Copy link

PiSaucer commented Nov 3, 2020

I am also missing an ARM build, I don't think it is 64. I have a raspberry pi 3 running Raspberry Pi OS and I am trying to use a discord bot that required canvas.

node-pre-gyp WARN Using needle for node-pre-gyp https download
node-pre-gyp WARN Tried to download(404): https://github.com/node-gfx/node-canvas-prebuilt/releases/download/v2.6.1/canvas-v2.6.1-node-v83-linux-glibc-arm.tar.gz
node-pre-gyp WARN Pre-built binaries not found for canvas@2.6.1 and node@14.8.0 (node-v83 ABI, glibc) (falling back to source compile with node-gyp)
Package pixman-1 was not found in the pkg-config search path.
Perhaps you should add the directory containing pixman-1.pc
to the PKG_CONFIG_PATH environment variable
No package pixman-1 found
gyp: Call to pkg-config pixman-1 --libs returned exit status 1 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Linux 4.19.118-v7+
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/home/pi/newcalxp/node_modules/canvas/build/Release/canvas.node" "--module_name=canvas" "--module_path=/home/pi/newcalxp/node_modules/canvas/build/Release" "--napi_version=6" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v83"
gyp ERR! cwd /home/pi/newcalxp/node_modules/canvas
gyp ERR! node -v v14.8.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/pi/newcalxp/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/home/pi/newcalxp/node_modules/canvas/build/Release --napi_version=6 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/pi/newcalxp/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1051:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
node-pre-gyp ERR! System Linux 4.19.118-v7+
node-pre-gyp ERR! command "/usr/bin/node" "/home/pi/newcalxp/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/pi/newcalxp/node_modules/canvas
node-pre-gyp ERR! node -v v14.8.0
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! not ok
Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/pi/newcalxp/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/home/pi/newcalxp/node_modules/canvas/build/Release --napi_version=6 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
npm WARN notsup Unsupported engine for openvg@0.4.5: wanted: {"node":">=0.8 <0.11"} (current: {"node":"14.8.0","npm":"6.14.7"})
npm WARN notsup Not compatible with your version of node/npm: openvg@0.4.5
npm WARN discord-tutorial-bot@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! canvas@2.6.1 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the canvas@2.6.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/pi/.npm/_logs/2020-11-03T21_19_36_436Z-debug.log

@Gustl22
Copy link

Gustl22 commented Jan 19, 2021

FYI: was able to build the package without error (Raspberry PI 3, Ubuntu 20.04 arm64):

$ sudo apt-get update 
$ sudo apt-get install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev
$ yarn add canvas

https://github.com/Automattic/node-canvas/wiki/Installation%3A-Ubuntu-and-other-Debian-based-systems

See also: #1511

@bevand10
Copy link

Given today's announcement from AWS re ARM based Lambda being generally available, will the std npm deploy ship with an appropriate binary?

https://aws.amazon.com/about-aws/whats-new/2021/09/better-price-performance-aws-lambda-functions-aws-graviton2-processor/

@tao1
Copy link

tao1 commented Dec 23, 2021

It is painful to use node-canvas on Apple Silicon.
Please provide prebuilt binaries for arm64.

@TJTorola
Copy link

TJTorola commented Mar 9, 2022

Same issues on Arch aarch64, I fixed it by installing pango & cairo, so pacman -S cairo pango

@landsman
Copy link

landsman commented Apr 5, 2022

I hit this when I did an upgrade my base image from: node:15.10-stretch to node:16.14-stretch.

In the image is already this:

RUN apt-get install -y build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev

to be able to build it from source...

The build was trying to download this URL:
#15 14.78 npm ERR! node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.9.1/canvas-v2.9.1-node-v93-linux-glibc-arm64.tar.gz

@ninjahamza
Copy link

latest version of rsvp(https://github.com/tildeio/rsvp.js ) and then a global install of node-pre-gyp is required again followed by installing latest version of canvas. Worked for me.
Mac M1, Node 16.14.2

@ghost
Copy link

ghost commented Oct 12, 2022

Any updates?

@laszlo-horvath
Copy link

Found a proposed solution here for M1 Mac. ✅

TL;DR:

  1. brew install pkg-config cairo pango libpng jpeg giflib librsvg
  2. Purge node_modules
  3. Re-install the package

@mgol
Copy link

mgol commented Mar 13, 2023

The issue shouldn't be closed since there are still no ARM64 binaries available. Can one of maintainers reopen?

@khalilsarwari
Copy link

Any update on this? Prebuilt arm images would be greatly appreciated :)

@indexxing
Copy link

I really hope the latest version will have arm64 pre-builds added eventually as I need to them to contribute to a project

@khalilsarwari
Copy link

This seems to be a drop-in replacement (minus some changes to font loading iirc) without the need for build during install for arm:
https://github.com/Brooooooklyn/canvas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests