Automattic/node-canvas

Getting error while running canvas using npm- node 18, python 3.12

rahuljustbaat opened this issue · 0 comments

> @layerhub-io/renderer@1.0.0 dev /Users/rahulkathuria/Documents/justbaat/layerhub-renderer
> node --experimental-specifier-resolution=node --loader ts-node/esm.mjs src/index.ts

(node:25059) ExperimentalWarning: `--experimental-loader` may be removed in the future; instead use `register()`:
--import 'data:text/javascript,import { register } from "node:module"; import { pathToFileURL } from "node:url"; register("ts-node/esm.mjs", pathToFileURL("./"));'
(Use `node --trace-warnings ...` to show where the warning was created)
(node:25059) ExperimentalWarning: The Node.js specifier resolution flag is experimental. It could change or be removed at any time.
(node:25059) ExperimentalWarning: The Node.js specifier resolution flag is experimental. It could change or be removed at any time.
(Use `node --trace-warnings ...` to show where the warning was created)
node:internal/modules/cjs/loader:1460
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: dlopen(/Users/rahulkathuria/Documents/justbaat/layerhub-renderer/node_modules/.pnpm/canvas@2.11.2_encoding@0.1.13/node_modules/canvas/build/Release/canvas.node, 0x0001): symbol not found in flat namespace '_cairo_fill'
    at Module._extensions..node (node:internal/modules/cjs/loader:1460:18)
    at Module.load (node:internal/modules/cjs/loader:1203:32)
    at Module._load (node:internal/modules/cjs/loader:1019:12)
    at Module.require (node:internal/modules/cjs/loader:1231:19)
    at require (node:internal/modules/helpers:177:18)
    at Object.<anonymous> (/Users/rahulkathuria/Documents/justbaat/layerhub-renderer/node_modules/.pnpm/canvas@2.11.2_encoding@0.1.13/node_modules/canvas/lib/bindings.js:3:18)
    at Module._compile (node:internal/modules/cjs/loader:1364:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)
    at Module.load (node:internal/modules/cjs/loader:1203:32)
    at Module._load (node:internal/modules/cjs/loader:1019:12) {
  code: 'ERR_DLOPEN_FAILED'
}

Node.js v18.20.4
 ELIFECYCLE  Command failed with exit code 1.