-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Can't install node-canvas because of the broken uri #2078
Comments
I'm facing the same issue, which could be related to ARM M1 Chips! |
Same here. Maybe this would help? #1733 I just wanted to use blurHash on some images, this is waaaay too deep of a rabbit hole for me to go through just for that 😄 |
I use macOS Monterey 12.4,I have been troubled in the same issue all day ,trying to find an solution here and there ,but nothing works and cause some new problems came out, and finally i decide to follow the readme tutorial "npm install --build-from-source" and it works. I believe there are something wrong with npm when you trying to use npm command to download the released assets in this repository, according to the log in my terminal , the url was incorrect .then i download it manually , npm run build ,it Error like this:/node_modules/canvas/build/Release/canvas.node' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')),apparently this problem is about the architecture ,so i just decide to install dependencies and use "--build-from-source" method . so happy it works. |
We have come across this this morning, you get a 404 because the release it's trying to fetch doesn't exist: The path is determined by the entry in the package json:
If all of the prebuilds are EDIT: The fallback build fails unless you have some deps installed, as found here: #913 (comment)
|
If you tried everything else from the above solutions and still failed, I solved by doing the following:
That solution worked on my Mac running on Rationale: I focused on the |
I had a similar problem, tried various ways. Finally @Codex- 's solution worked for me after running |
I did try everything mentioned above, I am still getting 404.
Here's the complete log: warning Workspaces can only be enabled in private projects.
[5/6] 🔨 Building fresh packages...
[8/39] ⢀ pulsar-client
[7/39] ⢀ unix-dgram
[3/39] ⢀ fsevents
[4/39] ⢀ canvas
error /Users/faran.shaikh/Documents/code/Sculptor/node_modules/canvas: Command failed.
Exit code: 1
Command: node-pre-gyp install --fallback-to-build --update-binary
Arguments:
Directory: /Users/faran.shaikh/Documents/code/Sculptor/node_modules/canvas
Output:
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp@1.0.11
node-pre-gyp info using node@20.14.0 | darwin | arm64
node-pre-gyp http GET https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v115-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.11.2/canvas-v2.11.2-node-v115-darwin-unknown-arm64.tar.gz
node-pre-gyp WARN Pre-built binaries not installable for canvas@2.11.2 and node@20.14.0 (node-v115 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.11.2/canvas-v2.11.2-node-v115-darwin-unknown-arm64.tar.gz
gyp info it worked if it ends with ok
gyp info using node-gyp@9.4.0
gyp info using node@20.14.0 | darwin | arm64
gyp info ok
gyp info it worked if it ends with ok
gyp info using node-gyp@9.4.0
gyp info using node@20.14.0 | darwin | arm64
gyp info find Python using Python version 3.12.3 found at "/opt/homebrew/opt/python@3.12/bin/python3.12"
gyp info spawn /opt/homebrew/opt/python@3.12/bin/python3.12
gyp info spawn args [
gyp info spawn args '/Users/faran.shaikh/Documents/code/Sculptor/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/faran.shaikh/Documents/code/Sculptor/node_modules/canvas/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/faran.shaikh/Documents/code/Sculptor/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/faran.shaikh/Library/Caches/node-gyp/20.14.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/faran.shaikh/Library/Caches/node-gyp/20.14.0',
gyp info spawn args '-Dnode_gyp_dir=/Users/faran.shaikh/Documents/code/Sculptor/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/Users/faran.shaikh/Library/Caches/node-gyp/20.14.0/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/Users/faran.shaikh/Documents/code/Sculptor/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/faran.shaikh/Documents/code/Sculptor/node_modules/node-gyp/gyp/gyp_main.py", line 42, in <module>
import gyp # noqa: E402
^^^^^^^^^^
File "/Users/faran.shaikh/Documents/code/Sculptor/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 9, in <module>
import gyp.input
File "/Users/faran.shaikh/Documents/code/Sculptor/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/faran.shaikh/Documents/code/Sculptor/node_modules/node-gyp/lib/configure.js:325:16)
gyp ERR! stack at ChildProcess.emit (node:events:519:28)
gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:294:12)
gyp ERR! System Darwin 23.5.0
gyp ERR! command "/Users/faran.shaikh/.nvm/versions/node/v20.14.0/bin/node" "/Users/faran.shaikh/Documents/code/Sculptor/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--update-binary" "--module=/Users/faran.shaikh/Documents/code/Sculptor/node_modules/canvas/build/Release/canvas.node" "--module_name=canvas" "--module_path=/Users/faran.shaikh/Documents/code/Sculptor/node_modules/canvas/build/Release" "--napi_version=9" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v115"
gyp ERR! cwd /Users/faran.shaikh/Documents/code/Sculptor/node_modules/canvas
gyp ERR! node -v v20.14.0
gyp ERR! node-gyp -v v9.4.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/Users/faran.shaikh/.nvm/versions/node/v20.14.0/bin/node /Users/faran.shaikh/Documents/code/Sculptor/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --update-binary --module=/Users/faran.shaikh/Documents/code/Sculptor/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/Users/faran.shaikh/Documents/code/Sculptor/node_modules/canvas/build/Release --napi_version=9 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v115' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/Users/faran.shaikh/Documents/code/Sculptor/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23)
node-pre-gyp ERR! stack at ChildProcess.emit (node:events:519:28)
node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1105:16)
node-pre-gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:305:5)
node-pre-gyp ERR! System Darwin 23.5.0
node-pre-gyp ERR! command "/Users/faran.shaikh/.nvm/versions/node/v20.14.0/bin/node" "/Users/faran.shaikh/Documents/code/Sculptor/node_modules/canvas/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--update-binary"
node-pre-gyp ERR! cwd /Users/faran.shaikh/Documents/code/Sculptor/node_modules/canvas
node-pre-gyp ERR! node -v v20.14.0
node-pre-gyp ERR! node-pre-gyp -v v1.0.11
node-pre-gyp ERR! not ok
Failed to execute '/Users/faran.shaikh/.nvm/versions/node/v20.14.0/bin/node /Users/faran.shaikh/Documents/code/Sculptor/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --update-binary --module=/Users/faran.shaikh/Documents/c
|
for anyone facing this issue, try use python 3.10.0, use pyenv, and set global to |
Is anyone able to install node-canvas? When using npm i -S canvas or yarn add canvas, I get to see the following issue (notice the url with the text unknown --> https://github.com/Automattic/node-canvas/releases/download/v2.9.3/canvas-v2.9.3-node-v102-darwin-unknown-arm64.tar.gz ):
The text was updated successfully, but these errors were encountered: