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

Cant build canvas on my Raspberry Pi #2205

Closed
1 task done
TheSainEyereg opened this issue Mar 3, 2023 · 2 comments
Closed
1 task done

Cant build canvas on my Raspberry Pi #2205

TheSainEyereg opened this issue Mar 3, 2023 · 2 comments

Comments

@TheSainEyereg
Copy link

Issue or Feature

Some time ago, one of my two Raspberry Pi's had a corrupted SD card. After some time, I got a new card and restored the image copied from the dead card. I restored all the damaged packages and libraries and the system works as before, but now for some reason I can't build canvas. An error appears:

npm ERR! code 1
npm ERR! path /home/ubuntu/ZeroBot-Discord/node_modules/canvas
npm ERR! command failed
npm ERR! command sh -c node-pre-gyp install --fallback-to-build --update-binary
npm ERR! make: Entering directory '/home/ubuntu/ZeroBot-Discord/node_modules/canvas/build'
npm ERR!   SOLINK_MODULE(target) Release/obj.target/canvas-postbuild.node
npm ERR!   COPY Release/canvas-postbuild.node
npm ERR!   CXX(target) Release/obj.target/canvas/src/backend/Backend.o
npm ERR! make: Leaving directory '/home/ubuntu/ZeroBot-Discord/node_modules/canvas/build'
npm ERR! Failed to execute '/home/ubuntu/.nvm/versions/node/v18.14.0/bin/node /home/ubuntu/.nvm/versions/node/v18.14.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --update-binary --module=/home/ubuntu/ZeroBot-Discord/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/home/ubuntu/ZeroBot-Discord/node_modules/canvas/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108' (1)
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using [email protected]
npm ERR! node-pre-gyp info using [email protected] | linux | arm64
npm ERR! node-pre-gyp http GET https://github.com/Automattic/node-canvas/releases/download/v2.11.0/canvas-v2.11.0-node-v108-linux-glibc-arm64.tar.gz
npm ERR! node-pre-gyp ERR! install response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.11.0/canvas-v2.11.0-node-v108-linux-glibc-arm64.tar.gz
npm ERR! node-pre-gyp WARN Pre-built binaries not installable for [email protected] and [email protected] (node-v108 ABI, glibc) (falling back to source compile with node-gyp)
npm ERR! node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.11.0/canvas-v2.11.0-node-v108-linux-glibc-arm64.tar.gz
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | linux | arm64
npm ERR! gyp info ok
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | linux | arm64
npm ERR! gyp info find Python using Python version 3.10.6 found at "/usr/bin/python3"
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/home/ubuntu/.nvm/versions/node/v18.14.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/ubuntu/ZeroBot-Discord/node_modules/canvas/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/ubuntu/.nvm/versions/node/v18.14.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/ubuntu/.cache/node-gyp/18.14.0/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/home/ubuntu/.cache/node-gyp/18.14.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/home/ubuntu/.nvm/versions/node/v18.14.0/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/home/ubuntu/.cache/node-gyp/18.14.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/home/ubuntu/ZeroBot-Discord/node_modules/canvas',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info ok
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | linux | arm64
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! In file included from /usr/include/c++/11/bits/exception_ptr.h:38,
npm ERR!                  from /usr/include/c++/11/exception:153,
npm ERR!                  from ../src/backend/Backend.h:5,
npm ERR!                  from ../src/backend/Backend.cc:1:
npm ERR! /usr/include/c++/11/bits/cxxabi_init_exception.h:38:10: fatal error: stddef.h: No such file or directory
npm ERR!    38 | #include <stddef.h>
npm ERR!       |          ^~~~~~~~~~
npm ERR! compilation terminated.
npm ERR! make: *** [canvas.target.mk:164: Release/obj.target/canvas/src/backend/Backend.o] Error 1
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack     at ChildProcess.onExit (/home/ubuntu/.nvm/versions/node/v18.14.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:203:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Linux 5.15.0-1024-raspi
npm ERR! gyp ERR! command "/home/ubuntu/.nvm/versions/node/v18.14.0/bin/node" "/home/ubuntu/.nvm/versions/node/v18.14.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--update-binary" "--module=/home/ubuntu/ZeroBot-Discord/node_modules/canvas/build/Release/canvas.node" "--module_name=canvas" "--module_path=/home/ubuntu/ZeroBot-Discord/node_modules/canvas/build/Release" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v108"
npm ERR! gyp ERR! cwd /home/ubuntu/ZeroBot-Discord/node_modules/canvas
npm ERR! gyp ERR! node -v v18.14.0
npm ERR! gyp ERR! node-gyp -v v9.3.0
npm ERR! gyp ERR! not ok
npm ERR! node-pre-gyp ERR! build error
npm ERR! node-pre-gyp ERR! stack Error: Failed to execute '/home/ubuntu/.nvm/versions/node/v18.14.0/bin/node /home/ubuntu/.nvm/versions/node/v18.14.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --update-binary --module=/home/ubuntu/ZeroBot-Discord/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/home/ubuntu/ZeroBot-Discord/node_modules/canvas/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108' (1)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/ubuntu/ZeroBot-Discord/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
npm ERR! node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1091:16)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:302:5)
npm ERR! node-pre-gyp ERR! System Linux 5.15.0-1024-raspi
npm ERR! node-pre-gyp ERR! command "/home/ubuntu/.nvm/versions/node/v18.14.0/bin/node" "/home/ubuntu/ZeroBot-Discord/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--update-binary"
npm ERR! node-pre-gyp ERR! cwd /home/ubuntu/ZeroBot-Discord/node_modules/canvas
npm ERR! node-pre-gyp ERR! node -v v18.14.0
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v1.0.10
npm ERR! node-pre-gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/ubuntu/.npm/_logs/2023-03-03T21_36_37_667Z-debug-0.log

I tried reinstalling all the dependencies, but that didn't help. At the same time on the first Raspberry Pi the package build still works, maybe we do not know about all the dependencies?

Steps to Reproduce

npm i canvas

Your Environment

  • Version of node-canvas (output of npm list canvas or yarn list canvas): [email protected]
  • Environment (e.g. node 4.2.0 on Mac OS X 10.8): node 18.14.0 on Ubuntu Server 22.04 on Raspberry Pi 4B (4GB RAM)
@maciekdzialo
Copy link

maciekdzialo commented Mar 14, 2023

It's failing because they removed some zipped files: https://github.com/Automattic/node-canvas/releases/download/v2.11.0/canvas-v2.11.0-node-v108-linux-glibc-arm64.tar.gz

npm ERR! node-pre-gyp http GET https://github.com/Automattic/node-canvas/releases/download/v2.11.0/canvas-v2.11.0-node-v108-linux-glibc-arm64.tar.gz

If they won't bring it back or fix the link (because maybe there's new link to this zipped files?) it won't work

@zbjornson
Copy link
Collaborator

We've never had ARM prebuilds. See the troubleshooting guide for more info:

If you have an ARM CPU

Prebuilds aren't available for ARM. Please see the wiki for guides on building from source. See also node-gfx/node-canvas-prebuilt#69.

@zbjornson zbjornson closed this as not planned Won't fix, can't repro, duplicate, stale Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants