When I use electron js and canvas in node js, I get a rebuild module error

21 Views Asked by At

Canvas and Electron JS work without errors when they are separate from each other. When I use them in the same project, I get the error below.

App threw an error during load
Error: The module '\\?\C:\Users\scray\OneDrive\Masaüstü\discord-v14\elektron\node_modules\canvas\build\Release\canvas.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 115. This version of Node.js requires
NODE_MODULE_VERSION 121. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at process.func [as dlopen] (node:electron/js2c/node_init:2:2214)
    at Module._extensions..node (node:internal/modules/cjs/loader:1343:18)
    at Object.func [as .node] (node:electron/js2c/node_init:2:2214)
    at Module.load (node:internal/modules/cjs/loader:1098:32)
    at Module._load (node:internal/modules/cjs/loader:945:12)
    at c._load (node:electron/js2c/node_init:2:13672)
    at Module.require (node:internal/modules/cjs/loader:1122:19)
    at require (node:internal/modules/helpers:130:18)
    at Object.<anonymous> (C:\Users\scray\OneDrive\Masa├╝st├╝\discord-v14\elektron\node_modules\canvas\lib\bindings.js:3:18)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)

enter image description here

I tried reinstalling the modules and node.js and upgrading to the latest version, what do I need to do to use canvas?

0

There are 0 best solutions below