GitMurf/help

Electron + pdfjs/node-canvas - Compiled against a different Node.js version - NODE_MODULE_VERSION 108 vs NODE_MODULE_VERSION 109

GitMurf opened this issue · 4 comments

First thing we need to solve is how to get pdfjs https://github.com/mozilla/pdf.js (with its node-canvas dependency as the issue) to be properly compiled against the correct version of Node that Electron is using since node-canvas is a native node module.

node-canvas (https://github.com/Automattic/node-canvas) does have pre-builds to use but there is not a version that matches to the Electron node version it seems.

image

I am testing on a Windows 11 machine right now.

Here is the project I am testing with right now: https://github.com/GitMurf/help/tree/main/electron-pdf-node-canvas-help

I have tried using electron-rebuild (https://github.com/electron/rebuild) 48050d5 but I get the following error.

image

Here is info about using native node modules with Electron: https://www.electronjs.org/docs/latest/tutorial/using-native-node-modules