bubblewrap icon indicating copy to clipboard operation
bubblewrap copied to clipboard

`canvas` causes installation to fail in some OS / Node.js version combinations

Open andreban opened this issue 5 years ago • 1 comments

Bubblewrap installation is failing on Chrome OS / Node 15.8.0 with the following error:

The issue is caused by the canvas module not having pre-compiled binaries for Node 15.8.0. The library installation then fallback to building the library locally, but Chrome OS is missing the required libraries for compiling the libraries locally.

Workarounds:

  • Use Node.Js 14.*
  • Install the required libraries to compile the canvas library locally:
sudo apt-get install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev

This is the error when installing @bubblewrap/cli

andreban@penguin:~$ npm i -g @bubblewrap/cli
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm notice
npm notice New patch version of npm available! 7.5.1 -> 7.5.2
npm notice Changelog: https://github.com/npm/cli/releases/tag/v7.5.2
npm notice Run npm install -g [email protected] to update!
npm notice
npm ERR! code 1
npm ERR! path /home/andreban/.config/nvm/versions/node/v15.8.0/lib/node_modules/@bubblewrap/cli/node_modules/canvas
npm ERR! command failed
npm ERR! command sh -c node-pre-gyp install --fallback-to-build
npm ERR! Failed to execute '/home/andreban/.config/nvm/versions/node/v15.8.0/bin/node /home/andreban/.config/nvm/versions/node/v15.8.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/andreban/.config/nvm/versions/node/v15.8.0/lib/node_modules/@bubblewrap/cli/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/home/andreban/.config/nvm/versions/node/v15.8.0/lib/node_modules/@bubblewrap/cli/node_modules/canvas/build/Release --napi_version=7 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v88' (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 | x64
npm ERR! node-pre-gyp WARN Using request for node-pre-gyp https download
npm ERR! node-pre-gyp info check checked for "/home/andreban/.config/nvm/versions/node/v15.8.0/lib/node_modules/@bubblewrap/cli/node_modules/canvas/build/Release/canvas.node" (not found)
npm ERR! node-pre-gyp http GET https://github.com/node-gfx/node-canvas-prebuilt/releases/download/v2.6.1/canvas-v2.6.1-node-v88-linux-glibc-x64.tar.gz
npm ERR! node-pre-gyp http 404 https://github.com/node-gfx/node-canvas-prebuilt/releases/download/v2.6.1/canvas-v2.6.1-node-v88-linux-glibc-x64.tar.gz
npm ERR! 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-v88-linux-glibc-x64.tar.gz
npm ERR! node-pre-gyp WARN Pre-built binaries not found for [email protected] and [email protected] (node-v88 ABI, glibc) (falling back to source compile with node-gyp)
npm ERR! node-pre-gyp http 404 status code downloading tarball https://github.com/node-gfx/node-canvas-prebuilt/releases/download/v2.6.1/canvas-v2.6.1-node-v88-linux-glibc-x64.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 | x64
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 | x64
npm ERR! gyp info find Python using Python version 3.7.3 found at "/usr/bin/python3"
npm ERR! gyp http GET https://nodejs.org/download/release/v15.8.0/node-v15.8.0-headers.tar.gz
npm ERR! gyp http 200 https://nodejs.org/download/release/v15.8.0/node-v15.8.0-headers.tar.gz
npm ERR! gyp http GET https://nodejs.org/download/release/v15.8.0/SHASUMS256.txt
npm ERR! gyp http 200 https://nodejs.org/download/release/v15.8.0/SHASUMS256.txt
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/home/andreban/.config/nvm/versions/node/v15.8.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/andreban/.config/nvm/versions/node/v15.8.0/lib/node_modules/@bubblewrap/cli/node_modules/canvas/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/andreban/.config/nvm/versions/node/v15.8.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/andreban/.cache/node-gyp/15.8.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/andreban/.cache/node-gyp/15.8.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/home/andreban/.config/nvm/versions/node/v15.8.0/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/home/andreban/.cache/node-gyp/15.8.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/home/andreban/.config/nvm/versions/node/v15.8.0/lib/node_modules/@bubblewrap/cli/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! /bin/sh: 1: pkg-config: not found
npm ERR! gyp: Call to 'pkg-config pixman-1 --libs' returned exit status 127 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.onCpExit (/home/andreban/.config/nvm/versions/node/v15.8.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:378:20)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Linux 5.4.89-12171-gd803e55c9964
npm ERR! gyp ERR! command "/home/andreban/.config/nvm/versions/node/v15.8.0/bin/node" "/home/andreban/.config/nvm/versions/node/v15.8.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/home/andreban/.config/nvm/versions/node/v15.8.0/lib/node_modules/@bubblewrap/cli/node_modules/canvas/build/Release/canvas.node" "--module_name=canvas" "--module_path=/home/andreban/.config/nvm/versions/node/v15.8.0/lib/node_modules/@bubblewrap/cli/node_modules/canvas/build/Release" "--napi_version=7" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v88"
npm ERR! gyp ERR! cwd /home/andreban/.config/nvm/versions/node/v15.8.0/lib/node_modules/@bubblewrap/cli/node_modules/canvas
npm ERR! gyp ERR! node -v v15.8.0
npm ERR! gyp ERR! node-gyp -v v7.1.2
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/andreban/.config/nvm/versions/node/v15.8.0/bin/node /home/andreban/.config/nvm/versions/node/v15.8.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/andreban/.config/nvm/versions/node/v15.8.0/lib/node_modules/@bubblewrap/cli/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/home/andreban/.config/nvm/versions/node/v15.8.0/lib/node_modules/@bubblewrap/cli/node_modules/canvas/build/Release --napi_version=7 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v88' (1)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/andreban/.config/nvm/versions/node/v15.8.0/lib/node_modules/@bubblewrap/cli/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:378:20)
npm ERR! node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1067:16)
npm ERR! node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
npm ERR! node-pre-gyp ERR! System Linux 5.4.89-12171-gd803e55c9964
npm ERR! node-pre-gyp ERR! command "/home/andreban/.config/nvm/versions/node/v15.8.0/bin/node" "/home/andreban/.config/nvm/versions/node/v15.8.0/lib/node_modules/@bubblewrap/cli/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
npm ERR! node-pre-gyp ERR! cwd /home/andreban/.config/nvm/versions/node/v15.8.0/lib/node_modules/@bubblewrap/cli/node_modules/canvas
npm ERR! node-pre-gyp ERR! node -v v15.8.0
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v0.11.0
npm ERR! node-pre-gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/andreban/.npm/_logs/2021-02-05T11_33_05_048Z-debug.log

@joycetoh8 @nohe427 FYI

andreban avatar Feb 05 '21 12:02 andreban

#455 is a similar issue on Fedora 33

andreban avatar Feb 05 '21 12:02 andreban

Replaced with resvgon #742

andreban avatar Aug 01 '23 09:08 andreban