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

node-canvas will not install. at all. #2378

Open
arcovaa opened this issue May 1, 2024 · 5 comments
Open

node-canvas will not install. at all. #2378

arcovaa opened this issue May 1, 2024 · 5 comments

Comments

@arcovaa
Copy link

arcovaa commented May 1, 2024

Most Frustrating Thing Ever

i've had a look at self trouble shooting page but it seems like my error is based on node-pre-gyp. no matter how many times i try to use it, it just doesn't work. but i have it globally installed on my system.

image

( )

clearly node-pre-gyp is there, but i tried pulling the repo & using node-gyp to do it, worked to a certain extent but i can't seem to npm link it to the main project, or any project in general.

im not even using windows, why can i not pre-build download this on linux ubuntu?

what i've got

i've got these dependancies:
sudo apt-get install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev
it seems like the biggest issue here is i cannot get node-pre-gyp to work, at all.

i even tried the --build-from-source flag, same thing.

weird questions

why does it some what respond to node-gyp but not node-pre-gyp? should i be installing the package in some weird spcieal way? it should be noted that i have @mapbox/node-pre-gyp, but thats the most recent right?

Your Environment

  • Version is difficult to tell, if only i could download it -
  • Environment (e.g. node 20.12.2 on Ubuntu 22.04.3 LTS):
@weskerty
Copy link

weskerty commented May 5, 2024

no work arm64

@inverse
Copy link

inverse commented May 5, 2024

Did something change recently? I noticed our CI started failing for our macos (arm64) GitHub build.

Logs
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm ERR! code 1
npm ERR! path /Users/runner/work/web-scrobbler/web-scrobbler/node_modules/canvas
npm ERR! command failed
npm ERR! command sh -c node-pre-gyp install --fallback-to-build --update-binary
npm ERR! Failed to execute '/Users/runner/hostedtoolcache/node/20.12.2/arm64/bin/node /Users/runner/hostedtoolcache/node/20.12.2/arm64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --update-binary --module=/Users/runner/work/web-scrobbler/web-scrobbler/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/Users/runner/work/web-scrobbler/web-scrobbler/node_modules/canvas/build/Release --napi_version=9 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v11[5](https://github.com/web-scrobbler/web-scrobbler/actions/runs/8902808795/job/24450278411#step:4:6)' (1)
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using node-pre-gyp@1.0.11
npm ERR! node-pre-gyp info using node@20.12.2 | darwin | arm[6](https://github.com/web-scrobbler/web-scrobbler/actions/runs/8902808795/job/24450278411#step:4:7)4
npm ERR! node-pre-gyp http GET https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v115-darwin-unknown-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.2/canvas-v2.11.2-node-v115-darwin-unknown-arm64.tar.gz 
npm ERR! node-pre-gyp WARN Pre-built binaries not installable for canvas@2.11.2 and node@20.12.2 (node-v115 ABI, unknown) (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.2/canvas-v2.11.2-node-v115-darwin-unknown-arm64.tar.gz 
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@10.0.1
npm ERR! gyp info using node@20.12.2 | darwin | arm64
npm ERR! gyp info ok 
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@10.0.1
npm ERR! gyp info using node@20.12.2 | darwin | arm64
npm ERR! gyp info find Python using Python version 3.12.3 found at "/opt/homebrew/opt/python@3.12/bin/python3.12"
npm ERR! gyp http GET https://nodejs.org/download/release/v20.12.2/node-v20.12.2-headers.tar.gz
npm ERR! gyp http 200 https://nodejs.org/download/release/v20.12.2/node-v20.12.2-headers.tar.gz
npm ERR! gyp http GET https://nodejs.org/download/release/v20.12.2/SHASUMS256.txt
npm ERR! gyp http 200 https://nodejs.org/download/release/v20.12.2/SHASUMS256.txt
npm ERR! gyp info spawn /opt/homebrew/opt/python@3.12/bin/python3.12
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '/Users/runner/hostedtoolcache/node/20.12.2/arm64/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 '/Users/runner/work/web-scrobbler/web-scrobbler/node_modules/canvas/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/runner/hostedtoolcache/node/20.12.2/arm64/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/runner/Library/Caches/node-gyp/20.12.2/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=/Users/runner/Library/Caches/node-gyp/20.12.2',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/Users/runner/hostedtoolcache/node/20.12.2/arm64/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/Users/runner/Library/Caches/node-gyp/20.12.2/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/Users/runner/work/web-scrobbler/web-scrobbler/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! Package pangocairo was not found in the pkg-config search path.
npm ERR! Perhaps you should add the directory containing `pangocairo.pc'
npm ERR! to the PKG_CONFIG_PATH environment variable
npm ERR! No package 'pangocairo' found
npm ERR! gyp: Call to 'pkg-config pangocairo --libs' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
npm ERR! gyp ERR! configure error 
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack at ChildProcess.<anonymous> (/Users/runner/hostedtoolcache/node/20.12.2/arm64/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:2[7](https://github.com/web-scrobbler/web-scrobbler/actions/runs/8902808795/job/24450278411#step:4:8)1:18)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:51[8](https://github.com/web-scrobbler/web-scrobbler/actions/runs/8902808795/job/24450278411#step:4:9):28)
npm ERR! gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:2[9](https://github.com/web-scrobbler/web-scrobbler/actions/runs/8902808795/job/24450278411#step:4:10)4:12)
npm ERR! gyp ERR! System Darwin 23.4.0
npm ERR! gyp ERR! command "/Users/runner/hostedtoolcache/node/20.12.2/arm64/bin/node" "/Users/runner/hostedtoolcache/node/20.12.2/arm64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--update-binary" "--module=/Users/runner/work/web-scrobbler/web-scrobbler/node_modules/canvas/build/Release/canvas.node" "--module_name=canvas" "--module_path=/Users/runner/work/web-scrobbler/web-scrobbler/node_modules/canvas/build/Release" "--napi_version=9" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v115"
npm ERR! gyp ERR! cwd /Users/runner/work/web-scrobbler/web-scrobbler/node_modules/canvas
npm ERR! gyp ERR! node -v v20.12.2
npm ERR! gyp ERR! node-gyp -v v[10](https://github.com/web-scrobbler/web-scrobbler/actions/runs/8902808795/job/24450278411#step:4:11).0.1
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 '/Users/runner/hostedtoolcache/node/20.12.2/arm64/bin/node /Users/runner/hostedtoolcache/node/20.12.2/arm64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --update-binary --module=/Users/runner/work/web-scrobbler/web-scrobbler/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/Users/runner/work/web-scrobbler/web-scrobbler/node_modules/canvas/build/Release --napi_version=9 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v[11](https://github.com/web-scrobbler/web-scrobbler/actions/runs/8902808795/job/24450278411#step:4:12)5' (1)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/runner/work/web-scrobbler/web-scrobbler/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:518:28)
npm ERR! node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1105:16)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:305:5)
npm ERR! node-pre-gyp ERR! System Darwin 23.4.0
npm ERR! node-pre-gyp ERR! command "/Users/runner/hostedtoolcache/node/20.[12](https://github.com/web-scrobbler/web-scrobbler/actions/runs/8902808795/job/24450278411#step:4:13).2/arm64/bin/node" "/Users/runner/work/web-scrobbler/web-scrobbler/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--update-binary"
npm ERR! node-pre-gyp ERR! cwd /Users/runner/work/web-scrobbler/web-scrobbler/node_modules/canvas
npm ERR! node-pre-gyp ERR! node -v v20.12.2
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v1.0.11
npm ERR! node-pre-gyp ERR! not ok

npm ERR! A complete log of this run can be found in: /Users/runner/.npm/_logs/2024-04-30T23_54_16_[13](https://github.com/web-scrobbler/web-scrobbler/actions/runs/8902808795/job/24450278411#step:4:14)8Z-debug-0.log

Last successful build was 2 weeks ago prior to this commit.

Update

Looks like it was due to the MacOS build agent was pinned to -latest which I guess got bumped from 12 to 13 internally. Pinning to macos-12 resolved the issue for us.

See: web-scrobbler/web-scrobbler#4688

@arcovaa
Copy link
Author

arcovaa commented May 11, 2024

no work arm64

hey man, im actually running
x86_64 on ubuntu, intel_64 bits, shouldn't it work for intel?

@chotixity
Copy link

I'm facing this error currently, did you find a solution or work around for it?

@danidaryaweesh
Copy link

Any solution for this issue? also facing this issue right now

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

5 participants