Skip to content

Module was compiled against a different Node.js version (error) #1636

Open
@fedekrum

Description

Hi there,

I agree with the latest @nornagon's comment at #200.
Electron Fiddle is a fantastic and simple playground for experimenting with Electron, but it would be incredibly helpful if errors like this one could be handled on the fly within the app itself.

Would it be possible to add an option in the Electron Fiddle settings to automatically resolve module version mismatches, such as a "Rebuild Native Modules" toggle (ON/OFF)? This would really enhance the user experience and make it easier to work with native modules like "midi 2.0.0" instead of getting stuck with them.

To reproduce the issue:

  1. Start with a clean Electron Fiddle project
  2. Add the [email protected] module.
  3. In the main.js file, add the following:
    const midi = require('midi');
  4. Press "Run".
    You will encounter the following error:
Electron v32.1.2 started.
App threw an error during load
Error: The module '/private/var/folders/2j/3qh45kk54w331n9q5shfcfs00000gr/T/electron-fiddle-2750-7huXbYxRwmi5/node_modules/midi/build/Release/midi.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 120. This version of Node.js requires
NODE_MODULE_VERSION 128. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
Thank you for considering this improvement, and thanks again for all the work you’ve done to make Electron Fiddle such a valuable tool for the community!

Best regards

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions