-
Notifications
You must be signed in to change notification settings - Fork 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
node:18-alpine build failing for canvas install #2086
Comments
Your issue is a combination of Automattic/node-canvas#2158 and Automattic/node-canvas#1065. The following works FROM node:18-alpine
WORKDIR /home/node
RUN set -ex; \
apk add --no-cache --virtual .gyp \
# Gyp build dependencies
python3 make g++ \
# Canvas build dependencies
pixman-dev cairo-dev pango-dev pkgconfig; \
npm install canvas; \
apk del .gyp |
This solution didn't work for me but I found a way to get it to work. Docker updated Alpine yesterday and reverse my dockerfile to the previous one worked : lts-alpine3.19 for Node 20 or 18-alpine3.19 for Node 18. |
@maxime-gd what error do you have? It worked for me for both alpine 3.19 and 3.20 |
Ran into the same distutils issue in a different project, had to revert to alpine3.19 to fix. I think maybe the python version was updated in alpine3.20 (to 3.12) and thus distutils is no longer available by default, so something like |
The same one as @sabreu-teknorix and @alex-statsig : distutils missing. |
The issue is this: nodejs/node-gyp#2869 and affects node:20-alpine and probably others as well. This is not just a canvas issue, it affects all node-gyp builds.
|
Maybe we need to append the docs about building native deps to document this |
PR to update the docs: #2099 |
Environment
Expected Behavior
build should not fail
Current Behavior
Build failing with stack trace
Possible Solution
Steps to Reproduce
Additional Information
The text was updated successfully, but these errors were encountered: