Closed kirill-martynov closed 1 year ago
Same error with node:18.12-alpine:
864.7 node-pre-gyp http GET https://github.com/Automattic/node-canvas/releases/download/v2.10.2/canvas-v2.10.2-node-v108-linux-musl-arm64.tar.gz
#12 864.7 node-pre-gyp ERR! install response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.10.2/canvas-v2.10.2-node-v108-linux-musl-arm64.tar.gz
#12 864.7 node-pre-gyp WARN Pre-built binaries not installable for canvas@2.10.2 and node@18.12.0 (node-v108 ABI, musl) (falling back to source compile with node-gyp)
#12 864.7 node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.10.2/canvas-v2.10.2-node-v108-linux-musl-arm64.tar.gz
I saw a Github Action failed, maybe it's related? https://github.com/Automattic/node-canvas/actions/runs/3353900475/jobs/5557061741#step:7:669
We don't have musl-libc prebuilds. More info in the troubleshooting guide:
Installation fails with a 404 in the log
If you're on Alpine Linux or another distro using musl-libc
The log may look like
node-pre-gyp WARN Tried to download(404): https://github.com/node-gfx/node-canvas-prebuilt/releases/download/v2.6.0/canvas-v2.6.0-node-v64-linux-musl-x64.tar.gz
Prebuilds are only available for glibc, not musl-libc. See https://github.com/node-gfx/node-canvas-prebuilt/issues/77, which includes information on building from source.
Hmm same issue for me. My pipeline is failing now. Not sure why It worked before
So, we've added this:
apk add --no-cache build-base g++ cairo-dev jpeg-dev pango-dev giflib-dev
apk add --update --repository http://dl-3.alpinelinux.org/alpine/edge/testing libmount ttf-dejavu ttf-droid ttf-freefont ttf-liberation ttf-ubuntu-font-family fontconfig
before:
RUN npm i -g cross-env webpack-cli \
&& yarn install --cache-folder /tmp/yarn \
&& rm -rf /tmp/*
And it's worked!
Issue
Can't get canvas, getting 404 error
Your Environment
package.json dependencies:
Dockerfile