Error: 'Module version mismatched' after using electron-rebuild


#1

Hi everyone !

I’m currently developping a package for atom but when I added some node modules and used electron-rebuild to rebuild headers, I got this :


I tried to get another version of pty.js but got the same thing.
I don’t understand what versions are mismatching ? Is that the module version or another one ?

If anyone can help me on this issue, it would be great ! :slight_smile:
Thank you in advance for your attention to this matter.


#2

I’m not knowledgeable enough to really help, but are you saying you upgraded a dependency of Atom without knowing if that’s still compatible with it?


#4

No.

In fact, as I said, I’m developing a package for atom. To do that, I
need some node.js modules like pty.js. But the first time, I activated
my package, I got : ‘Error: Module did not self-register.’.

To solve that, I found that I had to use electron-rebuild (which uses
the node.js module nslog) to rebuild node.js modules headers for
electron (if what I understood is right). So I used it but not now I get
the issues above : ‘Error: Module version mismatched. Expected 43, got
44.’ for the 2 node.js modules nslog and pty.js.


#5

You definitely don’t need to use (and shouldn’t use) electron-rebuild for rebuilding native modules - all of that is actually handled by apm. So to install dependencies, run apm install instead of npm install, as apm will compile native modules against the correct version of V8.


#6

OK, that worked !

I didn’t know that apm install also compiles native node modules.

Thanks !


#7

I’m having a similar problem here. But I already tried to run npm install and apm install and I’m still having the same problem.

Does anyone knows if this is a version problem?