fyears / electron-python-example

Electron as GUI of Python Applications
MIT License
2k stars 234 forks source link

getting node version mismatch on zerorpc #19

Closed sjatkins closed 6 years ago

sjatkins commented 6 years ago

I tired both npm installl from your packages .json and uninstalling and reinstalling zerorpc. I am on node 7.5.0 and npm v 4.1.2 on ubuntu 17.01

/home/samantha/work/electron-python-example/node_modules/zeromq/build/Release/zmq.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 51. This version of Node.js requires NODE_MODULE_VERSION 54. Please try re-compiling or re-installing the module (for instance, using npm rebuild ornpm install).

javimaravillas commented 6 years ago

Remove node_modules and run: npm cache clean npm install

steph-ben commented 6 years ago

I'm having almost the same issue, and the commands above didn't fix unfortunately

Uncaught Error: The module '/home/steph/dev/electron-python-example/node_modules/zeromq/build/Release/zmq.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 57. This version of Node.js requires
NODE_MODULE_VERSION 54. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or`npm install`)

Any other idea ? I'm quite new in npm/node/etc

lzkelley commented 6 years ago

I was having the same (or at least a similar?) issue. The fix was in the package.json file:

This is what the instructions say:

"devDependencies": {
      "electron": "^1.7.6",
}

The carat before the version number means at least 1.7.6, but I think we want specifically 1.7.6, so I changed it to:

"devDependencies": {
    "electron": "1.7.6",
}

which seemed to fix it. If this works for others, it should probably become a PR.


Edit: actually I needed one additional step to get things to work:

npm rebuild zeromq --runtime=electron --target=1.7.2
fyears commented 6 years ago

Hi all,

Sorry for the very late reply... I haven't maintain this repo for some dates.

But @lzkelley solved the problem and kindly posted the solution here. Thank you! :-)

The problem came from the frequent updates of nodejs community, so the version I used in the article got outdated very soon.

Actually I had mentioned the key point at https://github.com/fyears/electron-python-example#nodejs--electron-part. Anyone in the future could refer this issue and the post link. :-)