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

"npm install canvas" failing on upgrade to Ubuntu 24.04.LTS #2418

Open
carlb613 opened this issue Aug 16, 2024 · 1 comment
Open

"npm install canvas" failing on upgrade to Ubuntu 24.04.LTS #2418

carlb613 opened this issue Aug 16, 2024 · 1 comment

Comments

@carlb613
Copy link

Issue or Feature

I'm seeing issues with multiple machines which I've updated from Ubuntu 22 to the current Ubuntu 24.04 in which "npm install canvas" or "npm install -g canvas" attempts are failing with HTTP 404 errors:

npm error code 1
npm error path /usr/lib/node_modules/canvas
npm error command failed
npm error command sh -c node-pre-gyp install --fallback-to-build --update-binary
npm error Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --update-binary --module=/usr/lib/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/usr/lib/node_modules/canvas/build/Release --napi_version=9 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v109' (1)
npm error node-pre-gyp info it worked if it ends with ok
npm error node-pre-gyp info using [email protected]
npm error node-pre-gyp info using [email protected] | linux | x64
npm error node-pre-gyp http GET https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v109-linux-glibc-x64.tar.gz
npm error 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-v109-linux-glibc-x64.tar.gz
npm error node-pre-gyp WARN Pre-built binaries not installable for [email protected] and [email protected] (node-v109 ABI, glibc) (falling back to source compile with node-gyp)
npm error 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-v109-linux-glibc-x64.tar.gz

The only obvious way to recover from the error appears to be to read the fine manual at https://github.com/Automattic/node-canvas/wiki/Installation:-Ubuntu-and-other-Debian-based-systems#installing-dependencies and reinstall these dependencies which are listed in the install instructions:

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

This is on machines that already had working "npm" before the do-release-upgrade -d made the supposed "upgrade" to Ubuntu 24.04 LTS. There's nothing in the messages being displayed that indicates that a dependency issue is causing the problems.

Steps to Reproduce

  • Start with a working Ubuntu 22 setup with npm installed
  • Upgrade to the current Ubuntu with: sudo do-release-upgrade -d
  • Attempt to use the existing npm canvas installation; it fails, reporting the package to be missing
  • Attempt to "install npm -g canvas" - it fails with some very unhelpful HTTP 404 errors. Trying whatever URL's it is reporting as broken by opening them in a standard web browser does indicate they are indeed 404 / broken.
  • Install all of the dependencies (per the documentation) with: sudo apt install -y install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev
  • Attempt to "install npm -g canvas" - it suddenly works.

Your Environment

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 24.04 LTS
Release: 24.04
Codename: noble

$ npm -v
10.8.2

$ npm list canvas
/root
└── (empty)

The full error message (rather long) is:

npm install -g canvas

npm warn deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: This package is no longer supported.
npm error code 1
npm error path /usr/lib/node_modules/canvas
npm error command failed
npm error command sh -c node-pre-gyp install --fallback-to-build --update-binary
npm error Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --update-binary --module=/usr/lib/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/usr/lib/node_modules/canvas/build/Release --napi_version=9 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v109' (1)
npm error node-pre-gyp info it worked if it ends with ok
npm error node-pre-gyp info using [email protected]
npm error node-pre-gyp info using [email protected] | linux | x64
npm error node-pre-gyp http GET https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v109-linux-glibc-x64.tar.gz
npm error 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-v109-linux-glibc-x64.tar.gz
npm error node-pre-gyp WARN Pre-built binaries not installable for [email protected] and [email protected] (node-v109 ABI, glibc) (falling back to source compile with node-gyp)
npm error 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-v109-linux-glibc-x64.tar.gz
npm error gyp info it worked if it ends with ok
npm error gyp info using [email protected]
npm error gyp info using [email protected] | linux | x64
npm error gyp info ok
npm error gyp info it worked if it ends with ok
npm error gyp info using [email protected]
npm error gyp info using [email protected] | linux | x64
npm error gyp info find Python using Python version 3.12.3 found at "/usr/bin/python3"
npm error gyp info spawn /usr/bin/python3
npm error gyp info spawn args [
npm error gyp info spawn args '/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm error gyp info spawn args 'binding.gyp',
npm error gyp info spawn args '-f',
npm error gyp info spawn args 'make',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/usr/lib/node_modules/canvas/build/config.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/root/.cache/node-gyp/18.19.1/include/node/common.gypi',
npm error gyp info spawn args '-Dlibrary=shared_library',
npm error gyp info spawn args '-Dvisibility=default',
npm error gyp info spawn args '-Dnode_root_dir=/root/.cache/node-gyp/18.19.1',
npm error gyp info spawn args '-Dnode_gyp_dir=/usr/lib/node_modules/npm/node_modules/node-gyp',
npm error gyp info spawn args '-Dnode_lib_file=/root/.cache/node-gyp/18.19.1/<(target_arch)/node.lib',
npm error gyp info spawn args '-Dmodule_root_dir=/usr/lib/node_modules/canvas',
npm error gyp info spawn args '-Dnode_engine=v8',
npm error gyp info spawn args '--depth=.',
npm error gyp info spawn args '--no-parallel',
npm error gyp info spawn args '--generator-output',
npm error gyp info spawn args 'build',
npm error gyp info spawn args '-Goutput_dir=.'
npm error gyp info spawn args ]
npm error Package pixman-1 was not found in the pkg-config search path.
npm error Perhaps you should add the directory containing pixman-1.pc' npm error to the PKG_CONFIG_PATH environment variable npm error Package 'pixman-1', required by 'virtual:world', not found npm error gyp: Call to 'pkg-config pixman-1 --libs' returned exit status 1 while in binding.gyp. while trying to load binding.gyp npm error gyp ERR! configure error npm error gyp ERR! stack Error: gyp` failed with exit code: 1
npm error gyp ERR! stack at ChildProcess. (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:297:18)
npm error gyp ERR! stack at ChildProcess.emit (node:events:517:28)
npm error gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:292:12)
npm error gyp ERR! System Linux 6.8.0-40-generic
npm error gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--update-binary" "--module=/usr/lib/node_modules/canvas/build/Release/canvas.node" "--module_name=canvas" "--module_path=/usr/lib/node_modules/canvas/build/Release" "--napi_version=9" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v109"
npm error gyp ERR! cwd /usr/lib/node_modules/canvas
npm error gyp ERR! node -v v18.19.1
npm error gyp ERR! node-gyp -v v10.1.0
npm error gyp ERR! not ok
npm error node-pre-gyp ERR! build error
npm 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 --update-binary --module=/usr/lib/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/usr/lib/node_modules/canvas/build/Release --napi_version=9 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v109' (1)
npm error node-pre-gyp ERR! stack at ChildProcess. (/usr/lib/node_modules/canvas/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23)
npm error node-pre-gyp ERR! stack at ChildProcess.emit (node:events:517:28)
npm error node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1098:16)
npm error node-pre-gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:303:5)
npm error node-pre-gyp ERR! System Linux 6.8.0-40-generic
npm error node-pre-gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/canvas/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--update-binary"
npm error node-pre-gyp ERR! cwd /usr/lib/node_modules/canvas
npm error node-pre-gyp ERR! node -v v18.19.1
npm error node-pre-gyp ERR! node-pre-gyp -v v1.0.11
npm error node-pre-gyp ERR! not ok
npm error A complete log of this run can be found in: /root/.npm/_logs/2024-08-16T20_24_38_204Z-debug-0.log

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

Warning: The unit file, source configuration file or drop-ins of apt-news.service changed on disk. Run 'systemctl daemon-reload' to reload units.
Warning: The unit file, source configuration file or drop-ins of esm-cache.service changed on disk. Run 'systemctl daemon-reload' to reload units.
Hit:1 http://archive.ubuntu.com/ubuntu noble InRelease
Hit:2 http://security.ubuntu.com/ubuntu noble-security InRelease
Hit:3 http://ca.archive.ubuntu.com/ubuntu noble InRelease
Get:4 http://ca.archive.ubuntu.com/ubuntu noble-updates InRelease [126 kB]
Hit:5 http://ca.archive.ubuntu.com/ubuntu noble-backports InRelease
Get:6 http://ca.archive.ubuntu.com/ubuntu noble-updates/main i386 Packages [172 kB]
Get:7 http://ca.archive.ubuntu.com/ubuntu noble-updates/main amd64 Packages [348 kB]
Get:8 http://ca.archive.ubuntu.com/ubuntu noble-updates/universe amd64 Packages [323 kB]
Get:9 http://ca.archive.ubuntu.com/ubuntu noble-updates/universe i386 Packages [140 kB]
Fetched 1,109 kB in 1s (1,144 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
2 packages can be upgraded. Run 'apt list --upgradable' to see them.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
build-essential is already the newest version (12.10ubuntu1).
The following additional packages will be installed:
bzip2-doc gir1.2-freedesktop-dev gir1.2-girepository-2.0-dev gir1.2-glib-2.0-dev gobject-introspection
gobject-introspection-bin libblkid-dev libbrotli-dev libbz2-dev libdatrie-dev libdeflate-dev libfontconfig-dev libfreetype-dev
libfribidi-dev libgdk-pixbuf-2.0-dev libgirepository-1.0-dev libgirepository-2.0-0 libgirepository1.0-dev libglib2.0-dev
libglib2.0-dev-bin libgraphite2-dev libharfbuzz-cairo0 libharfbuzz-dev libice-dev libjbig-dev libjpeg-turbo8-dev libjpeg8-dev
liblerc-dev liblzma-dev libmount-dev libpixman-1-dev libpng-dev libpng-tools libselinux1-dev libsepol-dev libsharpyuv-dev
libsm-dev libthai-dev libtiff-dev libtiffxx6 libwebp-dev libwebpdecoder3 libxcb-render0-dev libxcb-shm0-dev libxft-dev
libxrender-dev libzstd-dev pango1.0-tools uuid-dev
Suggested packages:
libcairo2-doc libdatrie-doc freetype2-doc libgirepository1.0-doc libglib2.0-doc libxml2-utils libgraphite2-utils libice-doc
liblzma-doc libpango1.0-doc librsvg2-doc libsm-doc libthai-doc graphicsmagick
The following NEW packages will be installed:
bzip2-doc gir1.2-freedesktop-dev gir1.2-girepository-2.0-dev gir1.2-glib-2.0-dev gobject-introspection
gobject-introspection-bin libblkid-dev libbrotli-dev libbz2-dev libcairo2-dev libdatrie-dev libdeflate-dev libfontconfig-dev
libfreetype-dev libfribidi-dev libgdk-pixbuf-2.0-dev libgif-dev libgirepository-1.0-dev libgirepository-2.0-0
libgirepository1.0-dev libglib2.0-dev libglib2.0-dev-bin libgraphite2-dev libharfbuzz-cairo0 libharfbuzz-dev libice-dev
libjbig-dev libjpeg-dev libjpeg-turbo8-dev libjpeg8-dev liblerc-dev liblzma-dev libmount-dev libpango1.0-dev libpixman-1-dev
libpng-dev libpng-tools librsvg2-dev libselinux1-dev libsepol-dev libsharpyuv-dev libsm-dev libthai-dev libtiff-dev libtiffxx6
libwebp-dev libwebpdecoder3 libxcb-render0-dev libxcb-shm0-dev libxft-dev libxrender-dev libzstd-dev pango1.0-tools uuid-dev
0 upgraded, 54 newly installed, 0 to remove and 2 not upgraded.
Need to get 9,157 kB of archives.
After this operation, 50.4 MB of additional disk space will be used.
Get:1 http://ca.archive.ubuntu.com/ubuntu noble/main amd64 bzip2-doc all 1.0.8-5.1 [499 kB]
Get:2 http://ca.archive.ubuntu.com/ubuntu noble-updates/main amd64 gir1.2-glib-2.0-dev amd64 2.80.0-6ubuntu3.1 [848 kB]
Get:3 http://ca.archive.ubuntu.com/ubuntu noble/main amd64 gir1.2-freedesktop-dev amd64 1.80.1-1 [28.8 kB]
Get:4 http://ca.archive.ubuntu.com/ubuntu noble/main amd64 gir1.2-girepository-2.0-dev amd64 1.80.1-1 [41.5 kB]
Get:5 http://ca.archive.ubuntu.com/ubuntu noble/main amd64 gobject-introspection-bin amd64 1.80.1-1 [254 kB]
Get:6 http://ca.archive.ubuntu.com/ubuntu noble-updates/main amd64 libglib2.0-dev-bin amd64 2.80.0-6ubuntu3.1 [138 kB]
Get:7 http://ca.archive.ubuntu.com/ubuntu noble/main amd64 uuid-dev amd64 2.39.3-9ubuntu6 [33.5 kB]
Get:8 http://ca.archive.ubuntu.com/ubuntu noble/main amd64 libblkid-dev amd64 2.39.3-9ubuntu6 [204 kB]
Get:9 http://ca.archive.ubuntu.com/ubuntu noble/main amd64 libsepol-dev amd64 3.5-2build1 [384 kB]
Get:10 http://ca.archive.ubuntu.com/ubuntu noble/main amd64 libselinux1-dev amd64 3.5-2ubuntu2 [164 kB]
Get:11 http://ca.archive.ubuntu.com/ubuntu noble/main amd64 libmount-dev amd64 2.39.3-9ubuntu6 [14.9 kB]
Get:12 http://ca.archive.ubuntu.com/ubuntu noble-updates/main amd64 libgirepository-2.0-0 amd64 2.80.0-6ubuntu3.1 [73.5 kB]
Get:13 http://ca.archive.ubuntu.com/ubuntu noble-updates/main amd64 libglib2.0-dev amd64 2.80.0-6ubuntu3.1 [1,859 kB]
Get:14 http://ca.archive.ubuntu.com/ubuntu noble/main amd64 gobject-introspection amd64 1.80.1-1 [105 kB]
Get:15 http://ca.archive.ubuntu.com/ubuntu noble/main amd64 libbrotli-dev amd64 1.1.0-2build2 [353 kB]
Get:16 http://ca.archive.ubuntu.com/ubuntu noble/main amd64 libbz2-dev amd64 1.0.8-5.1 [33.6 kB]
Get:17 http://ca.archive.ubuntu.com/ubuntu noble/main amd64 libpng-dev amd64 1.6.43-5build1 [264 kB]
Get:18 http://ca.archive.ubuntu.com/ubuntu noble/main amd64 libfreetype-dev amd64 2.13.2+dfsg-1build3 [575 kB]
Get:19 http://ca.archive.ubuntu.com/ubuntu noble/main amd64 libfontconfig-dev amd64 2.15.0-1.1ubuntu2 [161 kB]
Get:20 http://ca.archive.ubuntu.com/ubuntu noble/main amd64 libpixman-1-dev amd64 0.42.2-1build1 [296 kB]
Get:21 http://ca.archive.ubuntu.com/ubuntu noble/main amd64 libice-dev amd64 2:1.0.10-1build3 [51.0 kB]
Get:22 http://ca.archive.ubuntu.com/ubuntu noble/main amd64 libsm-dev amd64 2:1.2.3-1build3 [17.8 kB]
Get:23 http://ca.archive.ubuntu.com/ubuntu noble/main amd64 libxcb-render0-dev amd64 1.15-1ubuntu2 [19.6 kB]
Get:24 http://ca.archive.ubuntu.com/ubuntu noble/main amd64 libxcb-shm0-dev amd64 1.15-1ubuntu2 [8,246 B]
Get:25 http://ca.archive.ubuntu.com/ubuntu noble/main amd64 libxrender-dev amd64 1:0.9.10-1.1build1 [26.3 kB]
Get:26 http://ca.archive.ubuntu.com/ubuntu noble/main amd64 libcairo2-dev amd64 1.18.0-3build1 [41.1 kB]
Get:27 http://ca.archive.ubuntu.com/ubuntu noble/main amd64 libdatrie-dev amd64 0.2.13-3build1 [19.4 kB]
Get:28 http://ca.archive.ubuntu.com/ubuntu noble/main amd64 libdeflate-dev amd64 1.19-1build1 [50.9 kB]
Get:29 http://ca.archive.ubuntu.com/ubuntu noble/main amd64 libfribidi-dev amd64 1.0.13-3build1 [64.8 kB]
Get:30 http://ca.archive.ubuntu.com/ubuntu noble/main amd64 libjpeg-turbo8-dev amd64 2.1.5-2ubuntu2 [295 kB]
Get:31 http://ca.archive.ubuntu.com/ubuntu noble/main amd64 libjpeg8-dev amd64 8c-2ubuntu11 [1,484 B]
Get:32 http://ca.archive.ubuntu.com/ubuntu noble/main amd64 libjpeg-dev amd64 8c-2ubuntu11 [1,482 B]
Get:33 http://ca.archive.ubuntu.com/ubuntu noble/main amd64 libjbig-dev amd64 2.1-6.1ubuntu2 [27.9 kB]
Get:34 http://ca.archive.ubuntu.com/ubuntu noble/main amd64 liblzma-dev amd64 5.6.1+really5.4.5-1 [176 kB]
Get:35 http://ca.archive.ubuntu.com/ubuntu noble/main amd64 libzstd-dev amd64 1.5.5+dfsg2-2build1 [364 kB]
Get:36 http://ca.archive.ubuntu.com/ubuntu noble/main amd64 libwebpdecoder3 amd64 1.3.2-0.4build3 [114 kB]
Get:37 http://ca.archive.ubuntu.com/ubuntu noble/main amd64 libsharpyuv-dev amd64 1.3.2-0.4build3 [16.0 kB]
Get:38 http://ca.archive.ubuntu.com/ubuntu noble/main amd64 libwebp-dev amd64 1.3.2-0.4build3 [367 kB]
Get:39 http://ca.archive.ubuntu.com/ubuntu noble-updates/main amd64 libtiffxx6 amd64 4.5.1+git230720-4ubuntu2.1 [5,646 B]
Get:40 http://ca.archive.ubuntu.com/ubuntu noble/main amd64 liblerc-dev amd64 4.0.0+ds-4ubuntu2 [182 kB]
Get:41 http://ca.archive.ubuntu.com/ubuntu noble-updates/main amd64 libtiff-dev amd64 4.5.1+git230720-4ubuntu2.1 [338 kB]
Get:42 http://ca.archive.ubuntu.com/ubuntu noble-updates/main amd64 libgdk-pixbuf-2.0-dev amd64 2.42.10+dfsg-3ubuntu3.1 [48.0 kB]
Get:43 http://ca.archive.ubuntu.com/ubuntu noble/main amd64 libgif-dev amd64 5.2.2-1ubuntu1 [22.7 kB]
Get:44 http://ca.archive.ubuntu.com/ubuntu noble/main amd64 libgirepository-1.0-dev amd64 1.80.1-1 [28.5 kB]
Get:45 http://ca.archive.ubuntu.com/ubuntu noble/main amd64 libgirepository1.0-dev amd64 1.80.1-1 [17.0 kB]
Get:46 http://ca.archive.ubuntu.com/ubuntu noble/main amd64 libgraphite2-dev amd64 1.3.14-2build1 [14.7 kB]
Get:47 http://ca.archive.ubuntu.com/ubuntu noble/main amd64 libharfbuzz-cairo0 amd64 8.3.0-2build2 [26.2 kB]
Get:48 http://ca.archive.ubuntu.com/ubuntu noble/main amd64 libharfbuzz-dev amd64 8.3.0-2build2 [142 kB]
Get:49 http://ca.archive.ubuntu.com/ubuntu noble/main amd64 libthai-dev amd64 0.1.29-2build1 [26.6 kB]
Get:50 http://ca.archive.ubuntu.com/ubuntu noble/main amd64 libxft-dev amd64 2.3.6-1build1 [64.3 kB]
Get:51 http://ca.archive.ubuntu.com/ubuntu noble/main amd64 pango1.0-tools amd64 1.52.1+ds-1build1 [36.7 kB]
Get:52 http://ca.archive.ubuntu.com/ubuntu noble/main amd64 libpango1.0-dev amd64 1.52.1+ds-1build1 [147 kB]
Get:53 http://ca.archive.ubuntu.com/ubuntu noble/main amd64 libpng-tools amd64 1.6.43-5build1 [28.5 kB]
Get:54 http://ca.archive.ubuntu.com/ubuntu noble/universe amd64 librsvg2-dev amd64 2.58.0+dfsg-1build1 [38.0 kB]
Fetched 9,157 kB in 6s (1,516 kB/s)
Extracting templates from packages: 100%
Selecting previously unselected package bzip2-doc.
(Reading database ... 566608 files and directories currently installed.)
Preparing to unpack .../00-bzip2-doc_1.0.8-5.1_all.deb ...
Unpacking bzip2-doc (1.0.8-5.1) ...
Selecting previously unselected package gir1.2-glib-2.0-dev:amd64.
Preparing to unpack .../01-gir1.2-glib-2.0-dev_2.80.0-6ubuntu3.1_amd64.deb ...
Unpacking gir1.2-glib-2.0-dev:amd64 (2.80.0-6ubuntu3.1) ...
Selecting previously unselected package gir1.2-freedesktop-dev:amd64.
Preparing to unpack .../02-gir1.2-freedesktop-dev_1.80.1-1_amd64.deb ...
Unpacking gir1.2-freedesktop-dev:amd64 (1.80.1-1) ...
Selecting previously unselected package gir1.2-girepository-2.0-dev:amd64.
Preparing to unpack .../03-gir1.2-girepository-2.0-dev_1.80.1-1_amd64.deb ...
Unpacking gir1.2-girepository-2.0-dev:amd64 (1.80.1-1) ...
Selecting previously unselected package gobject-introspection-bin.
Preparing to unpack .../04-gobject-introspection-bin_1.80.1-1_amd64.deb ...
Unpacking gobject-introspection-bin (1.80.1-1) ...
Selecting previously unselected package libglib2.0-dev-bin.
Preparing to unpack .../05-libglib2.0-dev-bin_2.80.0-6ubuntu3.1_amd64.deb ...
Unpacking libglib2.0-dev-bin (2.80.0-6ubuntu3.1) ...
Selecting previously unselected package uuid-dev:amd64.
Preparing to unpack .../06-uuid-dev_2.39.3-9ubuntu6_amd64.deb ...
Unpacking uuid-dev:amd64 (2.39.3-9ubuntu6) ...
Selecting previously unselected package libblkid-dev:amd64.
Preparing to unpack .../07-libblkid-dev_2.39.3-9ubuntu6_amd64.deb ...
Unpacking libblkid-dev:amd64 (2.39.3-9ubuntu6) ...
Selecting previously unselected package libsepol-dev:amd64.
Preparing to unpack .../08-libsepol-dev_3.5-2build1_amd64.deb ...
Unpacking libsepol-dev:amd64 (3.5-2build1) ...
Selecting previously unselected package libselinux1-dev:amd64.
Preparing to unpack .../09-libselinux1-dev_3.5-2ubuntu2_amd64.deb ...
Unpacking libselinux1-dev:amd64 (3.5-2ubuntu2) ...
Selecting previously unselected package libmount-dev:amd64.
Preparing to unpack .../10-libmount-dev_2.39.3-9ubuntu6_amd64.deb ...
Unpacking libmount-dev:amd64 (2.39.3-9ubuntu6) ...
Selecting previously unselected package libgirepository-2.0-0:amd64.
Preparing to unpack .../11-libgirepository-2.0-0_2.80.0-6ubuntu3.1_amd64.deb ...
Unpacking libgirepository-2.0-0:amd64 (2.80.0-6ubuntu3.1) ...
Selecting previously unselected package libglib2.0-dev:amd64.
Preparing to unpack .../12-libglib2.0-dev_2.80.0-6ubuntu3.1_amd64.deb ...
Unpacking libglib2.0-dev:amd64 (2.80.0-6ubuntu3.1) ...
Selecting previously unselected package gobject-introspection:amd64.
Preparing to unpack .../13-gobject-introspection_1.80.1-1_amd64.deb ...
Unpacking gobject-introspection:amd64 (1.80.1-1) ...
Selecting previously unselected package libbrotli-dev:amd64.
Preparing to unpack .../14-libbrotli-dev_1.1.0-2build2_amd64.deb ...
Unpacking libbrotli-dev:amd64 (1.1.0-2build2) ...
Selecting previously unselected package libbz2-dev:amd64.
Preparing to unpack .../15-libbz2-dev_1.0.8-5.1_amd64.deb ...
Unpacking libbz2-dev:amd64 (1.0.8-5.1) ...
Selecting previously unselected package libpng-dev:amd64.
Preparing to unpack .../16-libpng-dev_1.6.43-5build1_amd64.deb ...
Unpacking libpng-dev:amd64 (1.6.43-5build1) ...
Selecting previously unselected package libfreetype-dev:amd64.
Preparing to unpack .../17-libfreetype-dev_2.13.2+dfsg-1build3_amd64.deb ...
Unpacking libfreetype-dev:amd64 (2.13.2+dfsg-1build3) ...
Selecting previously unselected package libfontconfig-dev:amd64.
Preparing to unpack .../18-libfontconfig-dev_2.15.0-1.1ubuntu2_amd64.deb ...
Unpacking libfontconfig-dev:amd64 (2.15.0-1.1ubuntu2) ...
Selecting previously unselected package libpixman-1-dev:amd64.
Preparing to unpack .../19-libpixman-1-dev_0.42.2-1build1_amd64.deb ...
Unpacking libpixman-1-dev:amd64 (0.42.2-1build1) ...
Selecting previously unselected package libice-dev:amd64.
Preparing to unpack .../20-libice-dev_2%3a1.0.10-1build3_amd64.deb ...
Unpacking libice-dev:amd64 (2:1.0.10-1build3) ...
Selecting previously unselected package libsm-dev:amd64.
Preparing to unpack .../21-libsm-dev_2%3a1.2.3-1build3_amd64.deb ...
Unpacking libsm-dev:amd64 (2:1.2.3-1build3) ...
Selecting previously unselected package libxcb-render0-dev:amd64.
Preparing to unpack .../22-libxcb-render0-dev_1.15-1ubuntu2_amd64.deb ...
Unpacking libxcb-render0-dev:amd64 (1.15-1ubuntu2) ...
Selecting previously unselected package libxcb-shm0-dev:amd64.
Preparing to unpack .../23-libxcb-shm0-dev_1.15-1ubuntu2_amd64.deb ...
Unpacking libxcb-shm0-dev:amd64 (1.15-1ubuntu2) ...
Selecting previously unselected package libxrender-dev:amd64.
Preparing to unpack .../24-libxrender-dev_1%3a0.9.10-1.1build1_amd64.deb ...
Unpacking libxrender-dev:amd64 (1:0.9.10-1.1build1) ...
Selecting previously unselected package libcairo2-dev:amd64.
Preparing to unpack .../25-libcairo2-dev_1.18.0-3build1_amd64.deb ...
Unpacking libcairo2-dev:amd64 (1.18.0-3build1) ...
Selecting previously unselected package libdatrie-dev:amd64.
Preparing to unpack .../26-libdatrie-dev_0.2.13-3build1_amd64.deb ...
Unpacking libdatrie-dev:amd64 (0.2.13-3build1) ...
Selecting previously unselected package libdeflate-dev:amd64.
Preparing to unpack .../27-libdeflate-dev_1.19-1build1_amd64.deb ...
Unpacking libdeflate-dev:amd64 (1.19-1build1) ...
Selecting previously unselected package libfribidi-dev:amd64.
Preparing to unpack .../28-libfribidi-dev_1.0.13-3build1_amd64.deb ...
Unpacking libfribidi-dev:amd64 (1.0.13-3build1) ...
Selecting previously unselected package libjpeg-turbo8-dev:amd64.
Preparing to unpack .../29-libjpeg-turbo8-dev_2.1.5-2ubuntu2_amd64.deb ...
Unpacking libjpeg-turbo8-dev:amd64 (2.1.5-2ubuntu2) ...
Selecting previously unselected package libjpeg8-dev:amd64.
Preparing to unpack .../30-libjpeg8-dev_8c-2ubuntu11_amd64.deb ...
Unpacking libjpeg8-dev:amd64 (8c-2ubuntu11) ...
Selecting previously unselected package libjpeg-dev:amd64.
Preparing to unpack .../31-libjpeg-dev_8c-2ubuntu11_amd64.deb ...
Unpacking libjpeg-dev:amd64 (8c-2ubuntu11) ...
Selecting previously unselected package libjbig-dev:amd64.
Preparing to unpack .../32-libjbig-dev_2.1-6.1ubuntu2_amd64.deb ...
Unpacking libjbig-dev:amd64 (2.1-6.1ubuntu2) ...
Selecting previously unselected package liblzma-dev:amd64.
Preparing to unpack .../33-liblzma-dev_5.6.1+really5.4.5-1_amd64.deb ...
Unpacking liblzma-dev:amd64 (5.6.1+really5.4.5-1) ...
Selecting previously unselected package libzstd-dev:amd64.
Preparing to unpack .../34-libzstd-dev_1.5.5+dfsg2-2build1_amd64.deb ...
Unpacking libzstd-dev:amd64 (1.5.5+dfsg2-2build1) ...
Selecting previously unselected package libwebpdecoder3:amd64.
Preparing to unpack .../35-libwebpdecoder3_1.3.2-0.4build3_amd64.deb ...
Unpacking libwebpdecoder3:amd64 (1.3.2-0.4build3) ...
Selecting previously unselected package libsharpyuv-dev:amd64.
Preparing to unpack .../36-libsharpyuv-dev_1.3.2-0.4build3_amd64.deb ...
Unpacking libsharpyuv-dev:amd64 (1.3.2-0.4build3) ...
Selecting previously unselected package libwebp-dev:amd64.
Preparing to unpack .../37-libwebp-dev_1.3.2-0.4build3_amd64.deb ...
Unpacking libwebp-dev:amd64 (1.3.2-0.4build3) ...
Selecting previously unselected package libtiffxx6:amd64.
Preparing to unpack .../38-libtiffxx6_4.5.1+git230720-4ubuntu2.1_amd64.deb ...
Unpacking libtiffxx6:amd64 (4.5.1+git230720-4ubuntu2.1) ...
Selecting previously unselected package liblerc-dev:amd64.
Preparing to unpack .../39-liblerc-dev_4.0.0+ds-4ubuntu2_amd64.deb ...
Unpacking liblerc-dev:amd64 (4.0.0+ds-4ubuntu2) ...
Selecting previously unselected package libtiff-dev:amd64.
Preparing to unpack .../40-libtiff-dev_4.5.1+git230720-4ubuntu2.1_amd64.deb ...
Unpacking libtiff-dev:amd64 (4.5.1+git230720-4ubuntu2.1) ...
Selecting previously unselected package libgdk-pixbuf-2.0-dev:amd64.
Preparing to unpack .../41-libgdk-pixbuf-2.0-dev_2.42.10+dfsg-3ubuntu3.1_amd64.deb ...
Unpacking libgdk-pixbuf-2.0-dev:amd64 (2.42.10+dfsg-3ubuntu3.1) ...
Selecting previously unselected package libgif-dev:amd64.
Preparing to unpack .../42-libgif-dev_5.2.2-1ubuntu1_amd64.deb ...
Unpacking libgif-dev:amd64 (5.2.2-1ubuntu1) ...
Selecting previously unselected package libgirepository-1.0-dev:amd64.
Preparing to unpack .../43-libgirepository-1.0-dev_1.80.1-1_amd64.deb ...
Unpacking libgirepository-1.0-dev:amd64 (1.80.1-1) ...
Selecting previously unselected package libgirepository1.0-dev.
Preparing to unpack .../44-libgirepository1.0-dev_1.80.1-1_amd64.deb ...
Unpacking libgirepository1.0-dev (1.80.1-1) ...
Selecting previously unselected package libgraphite2-dev:amd64.
Preparing to unpack .../45-libgraphite2-dev_1.3.14-2build1_amd64.deb ...
Unpacking libgraphite2-dev:amd64 (1.3.14-2build1) ...
Selecting previously unselected package libharfbuzz-cairo0:amd64.
Preparing to unpack .../46-libharfbuzz-cairo0_8.3.0-2build2_amd64.deb ...
Unpacking libharfbuzz-cairo0:amd64 (8.3.0-2build2) ...
Selecting previously unselected package libharfbuzz-dev:amd64.
Preparing to unpack .../47-libharfbuzz-dev_8.3.0-2build2_amd64.deb ...
Unpacking libharfbuzz-dev:amd64 (8.3.0-2build2) ...
Selecting previously unselected package libthai-dev:amd64.
Preparing to unpack .../48-libthai-dev_0.1.29-2build1_amd64.deb ...
Unpacking libthai-dev:amd64 (0.1.29-2build1) ...
Selecting previously unselected package libxft-dev:amd64.
Preparing to unpack .../49-libxft-dev_2.3.6-1build1_amd64.deb ...
Unpacking libxft-dev:amd64 (2.3.6-1build1) ...
Selecting previously unselected package pango1.0-tools.
Preparing to unpack .../50-pango1.0-tools_1.52.1+ds-1build1_amd64.deb ...
Unpacking pango1.0-tools (1.52.1+ds-1build1) ...
Selecting previously unselected package libpango1.0-dev:amd64.
Preparing to unpack .../51-libpango1.0-dev_1.52.1+ds-1build1_amd64.deb ...
Unpacking libpango1.0-dev:amd64 (1.52.1+ds-1build1) ...
Selecting previously unselected package libpng-tools.
Preparing to unpack .../52-libpng-tools_1.6.43-5build1_amd64.deb ...
Unpacking libpng-tools (1.6.43-5build1) ...
Selecting previously unselected package librsvg2-dev:amd64.
Preparing to unpack .../53-librsvg2-dev_2.58.0+dfsg-1build1_amd64.deb ...
Unpacking librsvg2-dev:amd64 (2.58.0+dfsg-1build1) ...
Setting up libglib2.0-dev-bin (2.80.0-6ubuntu3.1) ...
Setting up bzip2-doc (1.0.8-5.1) ...
Setting up libjpeg-turbo8-dev:amd64 (2.1.5-2ubuntu2) ...
Setting up libpixman-1-dev:amd64 (0.42.2-1build1) ...
Setting up libzstd-dev:amd64 (1.5.5+dfsg2-2build1) ...
Setting up libice-dev:amd64 (2:1.0.10-1build3) ...
Setting up libpng-tools (1.6.43-5build1) ...
Setting up libgirepository-2.0-0:amd64 (2.80.0-6ubuntu3.1) ...
Setting up libsm-dev:amd64 (2:1.2.3-1build3) ...
Setting up libfribidi-dev:amd64 (1.0.13-3build1) ...
Setting up gobject-introspection-bin (1.80.1-1) ...
Setting up libpng-dev:amd64 (1.6.43-5build1) ...
Setting up pango1.0-tools (1.52.1+ds-1build1) ...
Setting up libjbig-dev:amd64 (2.1-6.1ubuntu2) ...
Setting up libwebpdecoder3:amd64 (1.3.2-0.4build3) ...
Setting up libxcb-shm0-dev:amd64 (1.15-1ubuntu2) ...
Setting up libgraphite2-dev:amd64 (1.3.14-2build1) ...
Setting up libharfbuzz-cairo0:amd64 (8.3.0-2build2) ...
Setting up uuid-dev:amd64 (2.39.3-9ubuntu6) ...
Setting up libsepol-dev:amd64 (3.5-2build1) ...
Setting up libxcb-render0-dev:amd64 (1.15-1ubuntu2) ...
Setting up liblerc-dev:amd64 (4.0.0+ds-4ubuntu2) ...
Setting up liblzma-dev:amd64 (5.6.1+really5.4.5-1) ...
Setting up libdatrie-dev:amd64 (0.2.13-3build1) ...
Setting up libgif-dev:amd64 (5.2.2-1ubuntu1) ...
Setting up gir1.2-glib-2.0-dev:amd64 (2.80.0-6ubuntu3.1) ...
Setting up libjpeg8-dev:amd64 (8c-2ubuntu11) ...
Setting up libsharpyuv-dev:amd64 (1.3.2-0.4build3) ...
Setting up libtiffxx6:amd64 (4.5.1+git230720-4ubuntu2.1) ...
Setting up libdeflate-dev:amd64 (1.19-1build1) ...
Setting up libxrender-dev:amd64 (1:0.9.10-1.1build1) ...
Setting up libbrotli-dev:amd64 (1.1.0-2build2) ...
Setting up libbz2-dev:amd64 (1.0.8-5.1) ...
Setting up libblkid-dev:amd64 (2.39.3-9ubuntu6) ...
Setting up libselinux1-dev:amd64 (3.5-2ubuntu2) ...
Setting up libjpeg-dev:amd64 (8c-2ubuntu11) ...
Setting up gir1.2-girepository-2.0-dev:amd64 (1.80.1-1) ...
Setting up libfreetype-dev:amd64 (2.13.2+dfsg-1build3) ...
Setting up libwebp-dev:amd64 (1.3.2-0.4build3) ...
Setting up libtiff-dev:amd64 (4.5.1+git230720-4ubuntu2.1) ...
Setting up gir1.2-freedesktop-dev:amd64 (1.80.1-1) ...
Setting up libthai-dev:amd64 (0.1.29-2build1) ...
Setting up libmount-dev:amd64 (2.39.3-9ubuntu6) ...
Setting up libfontconfig-dev:amd64 (2.15.0-1.1ubuntu2) ...
Setting up libglib2.0-dev:amd64 (2.80.0-6ubuntu3.1) ...
Setting up libxft-dev:amd64 (2.3.6-1build1) ...
Processing triggers for libc-bin (2.39-0ubuntu8.2) ...
Processing triggers for man-db (2.12.0-4build2) ...
Processing triggers for libglib2.0-0t64:amd64 (2.80.0-6ubuntu3.1) ...
Setting up libcairo2-dev:amd64 (1.18.0-3build1) ...
Processing triggers for install-info (7.1-3build2) ...
Setting up libgdk-pixbuf-2.0-dev:amd64 (2.42.10+dfsg-3ubuntu3.1) ...
Setting up libharfbuzz-dev:amd64 (8.3.0-2build2) ...
Setting up gobject-introspection:amd64 (1.80.1-1) ...
Setting up libpango1.0-dev:amd64 (1.52.1+ds-1build1) ...
Setting up libgirepository-1.0-dev:amd64 (1.80.1-1) ...
Setting up libgirepository1.0-dev (1.80.1-1) ...
Setting up librsvg2-dev:amd64 (2.58.0+dfsg-1build1) ...

npm install -g canvas

npm warn deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: This package is no longer supported.

added 63 packages in 56s

6 packages are looking for funding
run npm fund for details

@greyHairChooseLife
Copy link

greyHairChooseLife commented Aug 19, 2024

something similar happens to me,

neofetch my system

OS: Manjaro Linux x86_64 
Host: H610M HD3P -CF 
Kernel: 6.1.103-1-MANJARO 
Uptime: 1 day, 58 mins 
Packages: 1441 (pacman), 1 (pkg) 
Shell: bash 5.2.26 
Resolution: 1080x1920, 3440x1440 
WM: i3 
Theme: Adapta-Nokto-Eta-Maia [GTK2/3] 
Icons: Papirus-Adapta-Nokto-Maia [GTK2/3] 
Terminal: urxvt 
Terminal Font: D2Coding 
CPU: 12th Gen Intel i9-12900 (24) @ 5.000GHz 
GPU: NVIDIA GeForce RTX 3060 
GPU: Intel AlderLake-S GT1 
Memory: 11490MiB / 31869MiB 
npm i canvas
$ npm i canvas
npm warn deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: This package is no longer supported.
npm error code 1
npm error path /home/sy/tt/node_modules/canvas
npm error command failed
npm error command sh -c node-pre-gyp install --fallback-to-build --update-binary
npm error Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js clean' (1)
npm error node-pre-gyp info it worked if it ends with ok
npm error node-pre-gyp info using [email protected]
npm error node-pre-gyp info using [email protected] | linux | x64
npm error (node:312394) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
npm error (Use `node --trace-deprecation ...` to show where the warning was created)
npm error node-pre-gyp http GET https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v127-linux-glibc-x64.tar.gz
npm error 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-v127-linux-glibc-x64.tar.gz 
npm error node-pre-gyp WARN Pre-built binaries not installable for [email protected] and [email protected] (node-v127 ABI, glibc) (falling back to source compile with node-gyp) 
npm error 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-v127-linux-glibc-x64.tar.gz 
npm error /usr/lib/node_modules/npm/node_modules/node-gyp/lib/log.js:81
npm error     procLog.pause()
npm error             ^
npm error
npm error TypeError: procLog.pause is not a function
npm error     at new Logger (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/log.js:81:13)
npm error     at Object.<anonymous> (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/log.js:165:11)
npm error     at Module._compile (node:internal/modules/cjs/loader:1504:14)
npm error     at Module._extensions..js (node:internal/modules/cjs/loader:1588:10)
npm error     at Module.load (node:internal/modules/cjs/loader:1282:32)
npm error     at Module._load (node:internal/modules/cjs/loader:1098:12)
npm error     at TracingChannel.traceSync (node:diagnostics_channel:315:14)
npm error     at wrapModuleLoad (node:internal/modules/cjs/loader:215:24)
npm error     at Module.require (node:internal/modules/cjs/loader:1304:12)
npm error     at require (node:internal/modules/helpers:123:16)
npm error
npm error Node.js v22.5.1
npm error node-pre-gyp ERR! build error 
npm 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 clean' (1)
npm error node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/sy/tt/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23)
npm error node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:520:28)
npm error node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1105:16)
npm error node-pre-gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:305:5)
npm error node-pre-gyp ERR! System Linux 6.1.103-1-MANJARO
npm error node-pre-gyp ERR! command "/usr/bin/node" "/home/sy/tt/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--update-binary"
npm error node-pre-gyp ERR! cwd /home/sy/tt/node_modules/canvas
npm error node-pre-gyp ERR! node -v v22.5.1
npm error node-pre-gyp ERR! node-pre-gyp -v v1.0.11
npm error node-pre-gyp ERR! not ok
npm error A complete log of this run can be found in: /home/sy/.npm/_logs/2024-08-19T04_55_08_581Z-debug-0.log

Solved for me (updated: "It actually did not solve my problem.")

Anyone using Windows x64 or Linux x64/glibc, please try npm install canvas@next to install v3.0.0-rc2. If you run into any problems, please open a new GitHub issue.

For any other platforms and architectures, v3.0.0 can be built from source following the compilation section of the readme.

Originally posted by @zbjornson in #2387 (comment)

Thanks for @zbjornson for this tip; it solved my issue.

Btw, this tip comes from README as a call out. But idk why it sounds like early-trial version of new features or upgrades to me, myself. That's why I didn't try it first. And I am sure this is my silliness.

Solved for real

With npm i canvas@next, I could anyway install this package but that didn't mean I could properly use this in my projects.

All I needed was npm cache clean --force. And then I was able to install normally with npm i canvas.

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

2 participants