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

Installation fails in Node.js v16 (missing prebuilds) #1791

Closed
airon-tark opened this issue Apr 27, 2021 · 11 comments
Closed

Installation fails in Node.js v16 (missing prebuilds) #1791

airon-tark opened this issue Apr 27, 2021 · 11 comments

Comments

@airon-tark
Copy link

airon-tark commented Apr 27, 2021

Can't install the module after upgrading to the latest Node version (16).
Before that it worked ok (Node 14)
I went through the installation guide - doing everything right.

Issue or Feature

Just can't install

Steps to Reproduce

mkdir test-project
cd test-project 
npm init
yarn add canvas

Your Environment

Mac Catalina 10.15.7
npm 7.10.0
node v16.0.0
yarn 1.22.10
canvas 2.7.0

Logs

Exit code: 1
Command: node-pre-gyp install --fallback-to-build
Arguments: 
Directory: /Users/airon/Projects/.../node_modules/canvas
Output:
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp@0.15.0
node-pre-gyp info using node@16.0.0 | darwin | x64
node-pre-gyp WARN Using request for node-pre-gyp https download 
node-pre-gyp info check checked for "/Users/airon/Projects/.../my-backend/node_modules/canvas/build/Release/canvas.node" (not found)
node-pre-gyp http GET https://github.com/Automattic/node-canvas/releases/download/v2.7.0/canvas-v2.7.0-node-v93-darwin-unknown-x64.tar.gz
node-pre-gyp http 404 https://github.com/Automattic/node-canvas/releases/download/v2.7.0/canvas-v2.7.0-node-v93-darwin-unknown-x64.tar.gz
node-pre-gyp WARN Tried to download(404): https://github.com/Automattic/node-canvas/releases/download/v2.7.0/canvas-v2.7.0-node-v93-darwin-unknown-x64.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for canvas@2.7.0 and node@16.0.0 (node-v93 ABI, unknown) (falling back to source compile with node-gyp) 
node-pre-gyp http 404 status code downloading tarball https://github.com/Automattic/node-canvas/releases/download/v2.7.0/canvas-v2.7.0-node-v93-darwin-unknown-x64.tar.gz 
gyp info it worked if it ends with ok
gyp info using node-gyp@7.1.2
gyp info using node@16.0.0 | darwin | x64
gyp info ok 
gyp info it worked if it ends with ok
gyp info using node-gyp@7.1.2
gyp info using node@16.0.0 | darwin | x64
gyp info find Python using Python version 2.7.16 found at "/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python"
(node:59745) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
(Use `node --trace-deprecation ...` to show where the warning was created)
gyp info spawn /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
gyp info spawn args [
gyp info spawn args   '/usr/local/Cellar/node/16.0.0_1/libexec/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/airon/Projects/.../my-backend/node_modules/canvas/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/local/Cellar/node/16.0.0_1/libexec/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/airon/Library/Caches/node-gyp/16.0.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/airon/Library/Caches/node-gyp/16.0.0',
gyp info spawn args   '-Dnode_gyp_dir=/usr/local/Cellar/node/16.0.0_1/libexec/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/airon/Library/Caches/node-gyp/16.0.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/airon/Projects/.../my-backend/node_modules/canvas',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
/bin/sh: pkg-config: command 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/local/Cellar/node/16.0.0_1/libexec/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (node:events:365:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
gyp ERR! System Darwin 19.6.0
gyp ERR! command "/usr/local/Cellar/node/16.0.0_1/bin/node" "/usr/local/Cellar/node/16.0.0_1/libexec/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/Users/airon/Projects/.../my-backend/node_modules/canvas/build/Release/canvas.node" "--module_name=canvas" "--module_path=/Users/airon/Projects/.../my-backend/node_modules/canvas/build/Release" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v93" "--python=/usr/bin/python"
gyp ERR! cwd /Users/airon/Projects/.../my-backend/node_modules/canvas
gyp ERR! node -v v16.0.0
gyp ERR! node-gyp -v v7.1.2
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp configure --fallback-to-build --module=/Users/airon/Projects/.../my-backend/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/Users/airon/Projects/.../my-backend/node_modules/canvas/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93 --python=/usr/bin/python' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/airon/Projects/.../my-backend/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:365:28)
node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1067:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
node-pre-gyp ERR! System Darwin 19.6.0
node-pre-gyp ERR! command "/usr/local/Cellar/node/16.0.0_1/bin/node" "/Users/airon/Projects/.../my-backend/node_modules/canvas/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/airon/Projects/.../my-backend/node_modules/canvas
node-pre-gyp ERR! node -v v16.0.0
node-pre-gyp ERR! node-pre-gyp -v v0.15.0
node-pre-gyp ERR! not ok 
@ridays2001
Copy link

I believe they need to add some extra binaries for Node v16. They had opened an issue for Node v15 (#1688). It took them 4 - 5 months to release the binaries then. Expect something like that here too.
image

@jonkoops
Copy link

@zbjornson could the binaries for Node 16 be added?

@zbjornson
Copy link
Collaborator

Prebuilds for Linux and MacOS just finished for Canvas v2.7.0 / Node.js v16.
Windows failed without an error message, will try to figure that out tonight.

@zbjornson zbjornson changed the title Can't install canvas - ERR! stack Error: gyp failed with exit code: 1 Installation fails in Node.js v16 (missing prebuilds) Apr 29, 2021
@carl-jin
Copy link

Prebuilds for Linux and MacOS just finished for Canvas v2.7.0 / Node.js v16.
Windows failed without an error message, will try to figure that out tonight.

hi, 👋 ,
do u provide ARM version?
same here 404, with node v14.16.3 and macbook M1
https://github.com/Automattic/node-canvas/releases/download/v2.7.0/canvas-v2.7.0-node-v83-darwin-unknown-arm64.tar.gz

@zbjornson
Copy link
Collaborator

And... Windows / Canvas v2.7.0 / Node.js v16 prebuilds are up!

@carl-jin not yet at least, #1794.

@steils
Copy link

steils commented Jul 4, 2021

@zbjornson

Right now:

node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp@0.11.0
node-pre-gyp info using node@16.4.0 | linux | x64
node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp info check checked for "/home/stefan/projects/element-web/node_modules/canvas/build/Release/canvas.node" (not found)
node-pre-gyp http GET https://github.com/node-gfx/node-canvas-prebuilt/releases/download/v2.6.1/canvas-v2.6.1-node-v93-linux-glibc-x64.tar.gz
node-pre-gyp http 404 https://github.com/node-gfx/node-canvas-prebuilt/releases/download/v2.6.1/canvas-v2.6.1-node-v93-linux-glibc-x64.tar.gz
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-v93-linux-glibc-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for canvas@2.6.1 and node@16.4.0 (node-v93 ABI, glibc) (falling back to source compile with node-gyp)
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-v93-linux-glibc-x64.tar.gz
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp clean' (Error: spawn node-gyp ENOENT)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/stefan/projects/element-web/node_modules/node-pre-gyp/lib/util/compile.js:77:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:394:28)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:288:12)
node-pre-gyp ERR! stack     at onErrorNT (node:internal/child_process:480:16)
node-pre-gyp ERR! stack     at processTicksAndRejections (node:internal/process/task_queues:83:21)
node-pre-gyp ERR! System Linux 5.12.13-gentoo-x86_64
node-pre-gyp ERR! command "/usr/bin/node" "/home/stefan/projects/element-web/node_modules/canvas/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/stefan/projects/element-web/node_modules/canvas
node-pre-gyp ERR! node -v v16.4.0
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! not ok

@Piwy-dev
Copy link

The installation on macOS Big Sur still fails. Will it be solved some day?

@fishsaidno
Copy link

Yeah, same errors as above for me with Node v16.13.0 and Catalina (10.15.7)

@zbjornson
Copy link
Collaborator

@steils you're trying to install 2.6.1, but only 2.7.0 has prebuilds published for Node.js v16.
@Piwy-dev @fishsaidno please post the exact error messages you're getting, they're usually all slightly different.

@luizas
Copy link

luizas commented Apr 1, 2022

Hi After upgrade to node 16 I see that error during install

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-v93-darwin-unknown-x64.tar.gz

Screenshot 2022-04-01 at 16 42 02

@zbjornson
Copy link
Collaborator

@luizas try installing canvas instead of canvas-prebuilt. We moved from the latter to the former in v2.7.0.

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

9 participants