question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rebuild native extension

See original GitHub issue

I have a native extension and I’d like to test it using electron-mocha. How can I run tests and make sure that the installed version of electron and extension that I built with #node-gyp are both built using the same runtime and are compatible?

I tried running ./node_modules/.bin/electron-rebuild ., it says ✔ Rebuild Complete but I am sure it didn’t do anything.

It seems that electron-rebuild only targets modules by name but that’s not the case here since my package.json is the module itself. Is it possible to point electron-rebuild to module.node or source code or bindings.gyp so it could do its magic?

Running electron throws error:

Module version mismatch. Expected 50, got 48.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
MarshallOfSoundcommented, Jun 16, 2017

I completely failed when committing this but this is now handled on this line in this commit 😆

https://github.com/electron/electron-rebuild/commit/885e9edc18d1d160be2e2a4ea419ed0451b0534c#diff-e954a0c620ecfedccb6c501ac9f5d046R83

Basically, we now check the root module as well so in your native module just run electron-rebuild . and it should work (note not released yet)

1reaction
teshoudongcommented, May 27, 2017

I have the same question

Read more comments on GitHub >

github_iconTop Results From Across the Web

Rubygems: Rebuild native extensions - makandra dev
This will reset all gems to a pristine state as if you'd reinstall them, and as a side effect, rebuild all native extensions....
Read more >
Rebuild bundler gems with native extensions - Coderwall
If you are using bundler to manage your project's gem dependencies, and you need to rebuild the native extensions for one of those...
Read more >
Do not rebuild native extensions on every install for git ...
+1 for this issue. We've noticed when we deploy to a running instance, bundle install will replace the native-library in a c-extension and...
Read more >
How to rebuild native Ruby gems after a lib/system upgrade?
How to rebuild a Ruby gem with a native extension, after a library or system upgrade?
Read more >
How do you precompile the native extensions for a ruby gem ...
Unpack the gem you want to rebuild: $ gem unpack nokogiri. Build your shiny new precompiled gem: $ rake native gem. You can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found