Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

[BUG] Canvas module returning a 404 download #450

Closed
SSP6904 opened this issue Jun 22, 2024 · 5 comments
Closed

[BUG] Canvas module returning a 404 download #450

SSP6904 opened this issue Jun 22, 2024 · 5 comments

Comments

@SSP6904
Copy link

SSP6904 commented Jun 22, 2024

I'm trying to use the Yarn install command within the directory where the project is at. However, the node-canvas module that the project requires is randomly returning a 404 GET request to it's release file on GitHub. The URL it was requesting also returns a 404 message in my web browser. Not sure why this is occurring considering that it was available and working last time I was using DaedalOS on my local machine. Can someone assist me on this?

Log

warning Error running install script for optional dependency: "/home/shaun/daedalOS/node_modules/canvas: Command failed.
Exit code: 1                                                                                                                                           
Command: node-pre-gyp install --fallback-to-build --update-binary                                                                                      
Arguments:                                                                                                                                             
Directory: /home/shaun/daedalOS/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@22.3.0 | linux | arm64                                                                                                    
(node:2034835) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.                           
(Use `node --trace-deprecation ...` to show where the warning was created)                                                                             
node-pre-gyp http GET https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v127-linux-glibc-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-v127
-linux-glibc-arm64.tar.gz                                                                                                                              
node-pre-gyp WARN Pre-built binaries not installable for canvas@2.11.2 and node@22.3.0 (node-v127 ABI, glibc) (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-v1
27-linux-glibc-arm64.tar.gz                                                                                                                            
gyp info it worked if it ends with ok                                                                                                                  
gyp info using node-gyp@10.1.0                                                                                                                         
gyp info using node@22.3.0 | linux | arm64                                                                                                             
gyp info ok                                                                                                                                            
gyp info it worked if it ends with ok                                                                                                                  
gyp info using node-gyp@10.1.0                                                                                                                         
gyp info using node@22.3.0 | linux | arm64                                                                                                             
gyp info find Python using Python version 3.12.3 found at \"/usr/bin/python3\"                                                                         
@SuperMaxusa
Copy link

see Automattic/node-canvas#1662

@DustinBrett
Copy link
Owner

I guess this is because you are running on a Apple ARM CPU? I am not sure if there is a way around this currently if that is the case.

I wonder if that linked issue is indeed related, I don't see a fix coming in yet.

Any suggestions what I could change as I don't have a machine to reproduce this issue?

@SuperMaxusa
Copy link

SuperMaxusa commented Jun 27, 2024

As I correct understand, node-canvas comes from some dependency(ies).
Closer to issue, I think needed to try build this package itself on that ARM64: https://github.com/Automattic/node-canvas/wiki#installation-guides and npm_config_build_from_source=true yarn install (from https://stackoverflow.com/a/55368337)

as I don't have a machine to reproduce this issue?

Here are the guides for running ARM64 Linux on QEMU:

or via Docker:

...if that would be helpful

@DustinBrett
Copy link
Owner

Perhaps the steps in the bug report can be followed to make sure node-canvas can be built?

If that doesn't work, you could consider removing the deps that require node-canvas / canvas, it seems like both are not critical and just involving typing (pdfjs-dist) or testing (jest-environment-jsdom).

C:\x>npm ls canvas
daedalos@2.0.0 C:\x
├─┬ jest-environment-jsdom@29.7.0
│ ├── canvas@2.11.2
│ └─┬ jsdom@20.0.3
│   └── canvas@2.11.2 deduped    
└─┬ pdfjs-dist@4.3.136
  └── canvas@2.11.2 deduped

@SuperMaxusa
Copy link

it seems like both are not critical and just involving typing (pdfjs-dist)

From pdfjs sources, it like a optional dependency: https://github.com/mozilla/pdfjs-dist/blob/5f07d5a4159bb99eee2f6143d1297f03b45bba58/package.json#L16.

Perhaps the steps in the bug report can be followed to make sure node-canvas can be built?

IIRC node-gyp can automatically rebuild a package if libs for your arch/os are not available.

I can check later running daedalOS on Debian if you want.

Repository owner locked and limited conversation to collaborators Jun 29, 2024
@DustinBrett DustinBrett converted this issue into discussion #452 Jun 29, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants