Closed
Description
Description:
Hi there,
I'm experiencing build failures when trying to install canvas@2.11.2
using Node.js v22.11.0. It appears there might be compatibility issues between this version of Node.js and the canvas
module.
Environment:
- Node.js Version: v22.11.0
- Canvas Version: 2.11.2
- Platform: Linux (Docker base image
node:lts-slim
as of October 2024) - Dependency Manager: npm
Steps to Reproduce:
-
Dockerfile Setup:
FROM node:lts-slim AS build RUN apt-get update && apt-get install -y --no-install-recommends \ make \ g++ \ dumb-init \ build-essential \ libcairo2-dev \ libpango1.0-dev \ libjpeg-dev \ libgif-dev \ librsvg2-dev \ python3 \ && rm -rf /var/lib/apt/lists/* WORKDIR /usr COPY package*.json tsconfig.json ./ RUN npm ci
-
Install Dependencies:
- Run
npm ci
to install all dependencies, includingcanvas@2.11.2
.
- Run
-
Observe the Build Failure:
- The installation fails during the build process of
canvas
.
- The installation fails during the build process of
Error Log Highlights:
npm ERR! code 1
npm ERR! path /usr/node_modules/canvas
npm ERR! command failed
npm ERR! command sh -c node-pre-gyp install --fallback-to-build --update-binary
npm ERR! make: Entering directory '/usr/node_modules/canvas/build'
npm ERR! SOLINK_MODULE(target) Release/obj.target/canvas-postbuild.node
npm ERR! COPY Release/canvas-postbuild.node
npm ERR! CXX(target) Release/obj.target/canvas/src/backend/Backend.o
npm ERR! In file included from ../src/backend/Backend.h:6,
npm ERR! from ../src/backend/Backend.cc:1:
npm ERR! ../../nan/nan.h: In function 'void Nan::SetAccessor(...)':
npm ERR! ../../nan/nan.h:2546:19: error: no matching function for call to 'v8::ObjectTemplate::SetAccessor(...)'
npm ERR! ...
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! node -v v22.11.0
Additional Information:
- Downgrading to Node.js v20.x resolves the issue;
canvas
installs without errors.
Questions:
-
Compatibility Confirmation:
- Is
canvas@2.11.2
compatible with Node.js v22.11? - If not, are there plans to support Node.js v22.x in an upcoming release?
- Is
-
Workarounds:
- Are there any recommended steps or patches to make
canvas
work with Node.js v22.x?
- Are there any recommended steps or patches to make
-
Dependency Updates:
- Should we expect updates to dependencies like
nan
to address this compatibility issue?
- Should we expect updates to dependencies like
Thank You:
Thank you for your time and assistance. Any guidance or updates on this matter would be greatly appreciated.
Metadata
Metadata
Assignees
Labels
No labels