Automattic / node-canvas

Node canvas is a Cairo backed Canvas implementation for NodeJS.
10.2k stars 1.17k forks source link

Error : NODE_MODULE_VERSION 102 #2429

Open rexx1010 opened 2 months ago

rexx1010 commented 2 months ago

Hello, actually I am experiencing the following error :

Error: The module '/home/container/node_modules/discord-canvas/node_modules/canvas/build/Release/canvas.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 102. This version of Node.js requires
NODE_MODULE_VERSION 115. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at Object.Module._extensions..node (node:internal/modules/cjs/loader:1586:18)
    at Module.load (node:internal/modules/cjs/loader:1288:32)
    at Function.Module._load (node:internal/modules/cjs/loader:1104:12)
    at Module.require (node:internal/modules/cjs/loader:1311:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (/home/container/node_modules/discord-canvas/node_modules/canvas/lib/bindings.js:3:18)
    at Module._compile (node:internal/modules/cjs/loader:1469:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)
    at Object.require.extensions.<computed> [as .js] (/usr/local/lib/node_modules/ts-node/src/index.ts:1608:43)
    at Module.load (node:internal/modules/cjs/loader:1288:32) {
  code: 'ERR_DLOPEN_FAILED'

Canvas Version : 2.11.2 Node : 20.17.0

I have tried previous versions of node too but I got the same error. I also tried npm install and yarn listed in the troubleshoot installation but still it didnt fix it. I even tried deleting the node_module folder and running npm install but it still didnt work. I have now tried every single version and every single command I could but still I'm experiencing this problem, Kindly help me fix the issue.

cerupcat commented 1 month ago

I'm having the same issue. Have you found a workaround.