Open waldolin opened 4 months ago
Same error here, targetting https://github.com/Automattic/node-canvas/releases/download/v2.9.3/canvas-v2.9.3-node-v93-darwin-unknown-arm64.tar.gz fails
I faced the same issue on MacOS (v14.5, M1 Pro chip). Environment: Node v18.20, npm v9.9.3
➜ explorer git:(hest-env-upgrade) ✗ npm install canvas
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: enzyme-adapter-utils@1.14.1
npm WARN Found: react@17.0.2
npm WARN node_modules/react
npm WARN peer react@"^17.0.1" from enzyme-adapter-react-17-updated@1.0.2
npm WARN node_modules/enzyme-adapter-react-17-updated
npm WARN dev enzyme-adapter-react-17-updated@"^1.0.2" from the root project
npm WARN 18 more (jest-environment-enzyme, react-dom, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react@"0.13.x || 0.14.x || ^15.0.0-0 || ^16.0.0-0" from enzyme-adapter-utils@1.14.1
npm WARN node_modules/enzyme-adapter-utils
npm WARN enzyme-adapter-utils@"^1.14.0" from enzyme-adapter-react-17-updated@1.0.2
npm WARN node_modules/enzyme-adapter-react-17-updated
npm WARN
npm WARN Conflicting peer dependency: react@16.14.0
npm WARN node_modules/react
npm WARN peer react@"0.13.x || 0.14.x || ^15.0.0-0 || ^16.0.0-0" from enzyme-adapter-utils@1.14.1
npm WARN node_modules/enzyme-adapter-utils
npm WARN enzyme-adapter-utils@"^1.14.0" from enzyme-adapter-react-17-updated@1.0.2
npm WARN node_modules/enzyme-adapter-react-17-updated
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: airbnb-prop-types@2.16.0
npm WARN Found: react@17.0.2
npm WARN node_modules/react
npm WARN peer react@"^17.0.1" from enzyme-adapter-react-17-updated@1.0.2
npm WARN node_modules/enzyme-adapter-react-17-updated
npm WARN dev enzyme-adapter-react-17-updated@"^1.0.2" from the root project
npm WARN 18 more (jest-environment-enzyme, react-dom, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react@"^0.14 || ^15.0.0 || ^16.0.0-alpha" from airbnb-prop-types@2.16.0
npm WARN node_modules/enzyme-adapter-utils/node_modules/airbnb-prop-types
npm WARN airbnb-prop-types@"^2.16.0" from enzyme-adapter-utils@1.14.1
npm WARN node_modules/enzyme-adapter-utils
npm WARN
npm WARN Conflicting peer dependency: react@16.14.0
npm WARN node_modules/react
npm WARN peer react@"^0.14 || ^15.0.0 || ^16.0.0-alpha" from airbnb-prop-types@2.16.0
npm WARN node_modules/enzyme-adapter-utils/node_modules/airbnb-prop-types
npm WARN airbnb-prop-types@"^2.16.0" from enzyme-adapter-utils@1.14.1
npm WARN node_modules/enzyme-adapter-utils
npm ERR! code 1
npm ERR! path /Users/ckeshavabs/explorer/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/ckeshavabs/.nvm/versions/node/v18.20.4/bin/node /Users/ckeshavabs/.nvm/versions/node/v18.20.4/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --update-binary --module=/Users/ckeshavabs/explorer/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/Users/ckeshavabs/explorer/node_modules/canvas/build/Release --napi_version=9 --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 node-pre-gyp@1.0.5
npm ERR! node-pre-gyp info using node@18.20.4 | darwin | arm64
npm ERR! node-pre-gyp http GET https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v108-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-v108-darwin-unknown-arm64.tar.gz
npm ERR! node-pre-gyp WARN Pre-built binaries not installable for canvas@2.11.2 and node@18.20.4 (node-v108 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-v108-darwin-unknown-arm64.tar.gz
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.4.1
npm ERR! gyp info using node@18.20.4 | 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@9.4.1
npm ERR! gyp info using node@18.20.4 | darwin | arm64
npm ERR! gyp info find Python using Python version 3.11.6 found at "/Users/ckeshavabs/xrpl-py/.venv/bin/python3"
npm ERR! gyp info spawn /Users/ckeshavabs/xrpl-py/.venv/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '/Users/ckeshavabs/.nvm/versions/node/v18.20.4/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/ckeshavabs/explorer/node_modules/canvas/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/ckeshavabs/.nvm/versions/node/v18.20.4/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/ckeshavabs/Library/Caches/node-gyp/18.20.4/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/ckeshavabs/Library/Caches/node-gyp/18.20.4',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/Users/ckeshavabs/.nvm/versions/node/v18.20.4/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/Users/ckeshavabs/Library/Caches/node-gyp/18.20.4/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/Users/ckeshavabs/explorer/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 pixman-1 was not found in the pkg-config search path.
npm ERR! Perhaps you should add the directory containing `pixman-1.pc'
npm ERR! to the PKG_CONFIG_PATH environment variable
npm ERR! No package 'pixman-1' found
npm ERR! gyp: Call to 'pkg-config pixman-1 --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.onCpExit (/Users/ckeshavabs/.nvm/versions/node/v18.20.4/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:325:16)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:517:28)
npm ERR! gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:292:12)
npm ERR! gyp ERR! System Darwin 23.5.0
npm ERR! gyp ERR! command "/Users/ckeshavabs/.nvm/versions/node/v18.20.4/bin/node" "/Users/ckeshavabs/.nvm/versions/node/v18.20.4/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--update-binary" "--module=/Users/ckeshavabs/explorer/node_modules/canvas/build/Release/canvas.node" "--module_name=canvas" "--module_path=/Users/ckeshavabs/explorer/node_modules/canvas/build/Release" "--napi_version=9" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v108"
npm ERR! gyp ERR! cwd /Users/ckeshavabs/explorer/node_modules/canvas
npm ERR! gyp ERR! node -v v18.20.4
npm ERR! gyp ERR! node-gyp -v v9.4.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/ckeshavabs/.nvm/versions/node/v18.20.4/bin/node /Users/ckeshavabs/.nvm/versions/node/v18.20.4/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --update-binary --module=/Users/ckeshavabs/explorer/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/Users/ckeshavabs/explorer/node_modules/canvas/build/Release --napi_version=9 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108' (1)
npm ERR! node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/Users/ckeshavabs/explorer/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23)
npm ERR! node-pre-gyp ERR! stack at ChildProcess.emit (node:events:517:28)
npm ERR! node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1098:16)
npm ERR! node-pre-gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:303:5)
npm ERR! node-pre-gyp ERR! System Darwin 23.5.0
npm ERR! node-pre-gyp ERR! command "/Users/ckeshavabs/.nvm/versions/node/v18.20.4/bin/node" "/Users/ckeshavabs/explorer/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--update-binary"
npm ERR! node-pre-gyp ERR! cwd /Users/ckeshavabs/explorer/node_modules/canvas
npm ERR! node-pre-gyp ERR! node -v v18.20.4
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v1.0.5
npm ERR! node-pre-gyp ERR! not ok
npm ERR! A complete log of this run can be found in: /Users/ckeshavabs/.npm/_logs/2024-07-22T18_23_29_052Z-debug-0.log
How can I fix this issue? canvas
is a dev-dependency for the project.
Hi, have you tried this (for MacOS): https://stackoverflow.com/questions/73297594/cannot-install-canvas-on-npm
Hi, have you tried this (for MacOS): https://stackoverflow.com/questions/73297594/cannot-install-canvas-on-npm
thanks, this helped
I had the same errors running Windows 10 x64, Node.js 22.4.1, neither stable nor next worked.
Turns out I completely missed the Wiki. Followed its instructions and installed the required dependencies.
@waldolin In your environment description, it looks like you're installing node-pre-gyp
, did you mean to install node-gyp
instead?
I had the same errors running Windows 10 x64, Node.js 22.4.1, neither stable nor next worked.
Turns out I completely missed the Wiki. Followed its instructions and installed the required dependencies.
@waldolin In your environment description, it looks like you're installing
node-pre-gyp
, did you mean to installnode-gyp
instead? npm install node-pre-gyp" failed
I had the same errors running Windows 10 x64, Node.js 22.4.1, neither stable nor next worked.
Turns out I completely missed the Wiki. Followed its instructions and installed the required dependencies.
Then the README should be updated. Because right at the top, it says: "By default, binaries for macOS, Linux and Windows will be downloaded." Those requirements are said to only be necessary if you choose to compile instead.
Issue or Feature
Steps to Reproduce
Your Environment
npm list canvas
oryarn list canvas
):added 67 packages in 4s
3 packages are looking for funding run
npm fund
for details PS C:\Users\lin.node-red> node -v v22.2.0