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

Canvas installation error for silicon arm64 #2407

Closed
1 task done
Aarbel opened this issue Jul 17, 2024 · 4 comments
Closed
1 task done

Canvas installation error for silicon arm64 #2407

Aarbel opened this issue Jul 17, 2024 · 4 comments

Comments

@Aarbel
Copy link

Aarbel commented Jul 17, 2024

Issue or Feature

Hi, i have this error installing canvas:

Exit code: 1
Command: node-pre-gyp install --fallback-to-build --update-binary
Arguments: 
Directory: /Users/mycomputer/Documents/app/node_modules/canvas
Output:
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using [email protected]
node-pre-gyp info using [email protected] | darwin | arm64
node-pre-gyp http GET https://github.com/Automattic/node-canvas/releases/download/v2.9.3/canvas-v2.9.3-node-v93-darwin-unknown-arm64.tar.gz
node-pre-gyp ERR! install response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.9.3/canvas-v2.9.3-node-v93-darwin-unknown-arm64.tar.gz 
node-pre-gyp WARN Pre-built binaries not installable for [email protected] and [email protected] (node-v93 ABI, unknown) (falling back to source compile with node-gyp) 
node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.9.3/canvas-v2.9.3-node-v93-darwin-unknown-arm64.tar.gz 
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | arm64
gyp info ok 
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | arm64
gyp info find Python using Python version 3.12.4 found at \"/opt/homebrew/opt/[email protected]/bin/python3.12\"
gyp info spawn /opt/homebrew/opt/[email protected]/bin/python3.12
gyp info spawn args [
gyp info spawn args   '/Users/mycomputer/.nvm/versions/node/v16.20.2/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/mycomputer/Documents/app/node_modules/canvas/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/mycomputer/.nvm/versions/node/v16.20.2/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/mycomputer/Library/Caches/node-gyp/16.20.2/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/mycomputer/Library/Caches/node-gyp/16.20.2',
gyp info spawn args   '-Dnode_gyp_dir=/Users/mycomputer/.nvm/versions/node/v16.20.2/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/mycomputer/Library/Caches/node-gyp/16.20.2/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/mycomputer/Documents/app/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 ]
Traceback (most recent call last):
  File \"/Users/mycomputer/.nvm/versions/node/v16.20.2/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py\", line 42, in <module>
    import gyp  # noqa: E402
    ^^^^^^^^^^
  File \"/Users/mycomputer/.nvm/versions/node/v16.20.2/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py\", line 9, in <module>
    import gyp.input
  File \"/Users/mycomputer/.nvm/versions/node/v16.20.2/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py\", line 19, in <module>
    from distutils.version import StrictVersion
ModuleNotFoundError: No module named 'distutils'
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/Users/mycomputer/.nvm/versions/node/v16.20.2/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:284:16)
gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:293:12)
gyp ERR! System Darwin 23.4.0
gyp ERR! command \"/Users/mycomputer/.nvm/versions/node/v16.20.2/bin/node\" \"/Users/mycomputer/.nvm/versions/node/v16.20.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js\" \"configure\" \"--fallback-to-build\" \"--update-binary\" \"--module=/Users/mycomputer/Documents/app/node_modules/canvas/build/Release/canvas.node\" \"--module_name=canvas\" \"--module_path=/Users/mycomputer/Documents/app/node_modules/canvas/build/Release\" \"--napi_version=8\" \"--node_abi_napi=napi\" \"--napi_build_version=0\" \"--node_napi_label=node-v93\"
gyp ERR! cwd /Users/mycomputer/Documents/app/node_modules/canvas
gyp ERR! node -v v16.20.2
gyp ERR! node-gyp -v v9.1.0
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/Users/mycomputer/.nvm/versions/node/v16.20.2/bin/node /Users/mycomputer/.nvm/versions/node/v16.20.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --update-binary --module=/Users/mycomputer/Documents/app/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/Users/mycomputer/Documents/app/node_modules/canvas/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/mycomputer/Documents/app/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23)
node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1100:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
node-pre-gyp ERR! System Darwin 23.4.0
node-pre-gyp ERR! command \"/Users/mycomputer/.nvm/versions/node/v16.20.2/bin/node\" \"/Users/mycomputer/Documents/app/node_modules/canvas/node_modules/.bin/node-pre-gyp\" \"install\" \"--fallback-to-build\" \"--update-binary\"
node-pre-gyp ERR! cwd /Users/mycomputer/Documents/app/node_modules/canvas
node-pre-gyp ERR! node -v v16.20.2
node-pre-gyp ERR! node-pre-gyp -v v1.0.9
node-pre-gyp ERR! not ok 
[16/28] ⠄ @pdftron/pdfnet-node
[12/28] ⠄ sharp
[-/28] ⠄ waiting...
[23/28] ⠄ @aaronhayes/hasura-cli
error /Users/mycomputer/Documents/app/node_modules/weak-napi: Command failed.
Exit code: 1
Command: node-gyp-build
Arguments: 
Directory: /Users/mycomputer/Documents/app/node_modules/weak-napi
Output:
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | arm64
gyp info find Python using Python version 3.12.4 found at "/opt/homebrew/opt/[email protected]/bin/python3.12"
gyp info spawn /opt/homebrew/opt/[email protected]/bin/python3.12
gyp info spawn args [
gyp info spawn args   '/Users/mycomputer/.nvm/versions/node/v16.20.2/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/mycomputer/Documents/app/node_modules/weak-napi/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/mycomputer/.nvm/versions/node/v16.20.2/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/mycomputer/Library/Caches/node-gyp/16.20.2/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/mycomputer/Library/Caches/node-gyp/16.20.2',
gyp info spawn args   '-Dnode_gyp_dir=/Users/mycomputer/.nvm/versions/node/v16.20.2/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/mycomputer/Library/Caches/node-gyp/16.20.2/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/mycomputer/Documents/app/node_modules/weak-napi',
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 ]
Traceback (most recent call last):
  File "/Users/mycomputer/.nvm/versions/node/v16.20.2/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 42, in <module>
    import gyp  # noqa: E402
    ^^^^^^^^^^
  File "/Users/mycomputer/.nvm/versions/node/v16.20.2/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 9, in <module>
    import gyp.input
  File "/Users/mycomputer/.nvm/versions/node/v16.20.2/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 19, in <module>
    from distutils.version import StrictVersion
ModuleNotFoundError: No module named 'distutils'
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/Users/mycomputer/.nvm/versions/node/v16.20.2/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:284:16)
gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:293:12)
gyp ERR! System Darwin 23.4.0
gyp ERR! command "/Users/mycomputer/.nvm/versions/node/v16.20.2/bin/node" "/Users/mycomputer/.nvm/versions/node/v16.20.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/mycomputer/Documents/app/node_modules/weak-napi

Do you know how to solve it ?

Looks like the url https://github.com/Automattic/node-canvas/releases/download/v2.9.3/canvas-v2.9.3-node-v93-darwin-unknown-arm64.tar.gz is down

@Aarbel
Copy link
Author

Aarbel commented Jul 17, 2024

Looks like the archive has been removed cf https://github.com/Automattic/node-canvas/releases/tag/v2.9.3

image

@Aarbel Aarbel changed the title Canvas installation error Canvas installation error for silicon arm64 Jul 17, 2024
@Aarbel
Copy link
Author

Aarbel commented Jul 17, 2024

cf #2406

running brew install pkg-config cairo pango libpng jpeg giflib librsvg pixman python-setuptools helps the installation to run, but it doesn't solve definitely the problem

@mrabdibdi-anvil
Copy link

Hello,

Hope it helps you, it seems to have fixed my issue:

sudo port install pkgconfig cairo pango libpng jpeg giflib librsvg -y
python3.12 -m pip install setuptools
npm install canvas

instead of port you can use brew as well

@zbjornson
Copy link
Collaborator

You're using an ARM CPU, which we don't have prebuilds for. Please see the troubleshooting guide for more info.

@zbjornson zbjornson closed this as not planned Won't fix, can't repro, duplicate, stale Jul 18, 2024
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

3 participants