Python中如何结合Electron、ZeroRPC和Vue.js进行开发?

首先我是想做一个 python 的 gui,但是 pyqt 太麻烦而且界面很丑。。

看上了 electron,最近用的好多软件都基于它而且界面很好看。。

python 和 elctron 的通讯使用的是 zerorpc。。这个也测通了 https://github.com/fyears/electron-python-example

electron 和 vue.js 我用的是脚手架,https://github.com/SimulatedGREG/electron-vue

现在问题来了。。我想 把三个合起来的时候出现了我不知道咋解决的问题。。

Uncaught Error: The module '/Users/c/Demo/demo_electron-vue/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`).
    at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:173:20)
    at Object.Module._extensions..node (module.js:598:18)
    at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:173:20)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/c/Demo/demo_electron-vue/node_modules/zeromq/lib/index.js:6:11)
    at Object.<anonymous> (/Users/c/Demo/demo_electron-vue/node_modules/zeromq/lib/index.js:840:3)

Python中如何结合Electron、ZeroRPC和Vue.js进行开发?

3 回复

我无法理解你的问题。


看起来是 node 版本不一致的问题,用 nvm 切换到对应的版本。

不太会,本来准备用 electron 做 GUI 的,现在的话有点迷糊了。

回到顶部