Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
fedekrum opened this issue Sep 26, 2024 · 0 comments
Open

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

fedekrum opened this issue Sep 26, 2024 · 0 comments
Labels
✨ enhancement New feature or request

Comments

@fedekrum
Copy link

fedekrum commented Sep 26, 2024

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 midi@2.0.0 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

@erickzhao erickzhao added the ✨ enhancement New feature or request label Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants