Hi,
I’m developing a backend plugin for theia application. This plugin use the serialport npm library.
When I run Theia as browser , no problem. The plugin work fine.
But when I try to run plugin on Theia as Electron app, it raise an error during the boot phase:
root ERROR [hosted-plugin: 18029] Error: The module '/theia/theia-ide-dev/theia/plugins/web-app-plugin/node_modules/@serialport/bindings/build/Release/bindings.node' <br>
was compiled against a different Node.js version using
NODE_MODULE_VERSION 64. This version of Node.js requires
NODE_MODULE_VERSION 69. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:160:31)
at Object.Module._extensions..node (internal/modules/cjs/loader.js:722:18)
at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:160:31)
at Module.load (internal/modules/cjs/loader.js:602:32)
at tryModuleLoad (internal/modules/cjs/loader.js:541:12)
at Function.Module._load (internal/modules/cjs/loader.js:533:3)
at Function.module._load (/theia/theia-ide-dev/theia/packages/plugin-ext-vscode/lib/node/plugin-vscode-init.js:80:33)
at Function.module._load (/theia/theia-ide-dev/theia/packages/plugin-ext/lib/hosted/node/scanners/backend-init-theia.js:42:33)
at Module.require (internal/modules/cjs/loader.js:640:17)
at require (internal/modules/cjs/helpers.js:20:18)`
I tried to use electron-rebuild in order to fix this issue, unsuccessfully.
So , my question is: there is a way to build plugin being aware of electron node version?
Regards,
Davide
[original thread by davide-sergi]