2017-05-22 4 views
0

私はノード/ npm /電子のnoobですが、私が書いた既存のPythonモジュールとインターフェイスするための電子アプリを作成しようとしていて、私はthis Github repoを見つけました。だから私はそれをクローンして、Linux mint cinnamon version 3.2.7から実行しようとしています。電子アプリケーションが起動しますが、pythonコンポーネントは動作しません。開発者ツールを開くと、コンソールにこのエラーメッセージが表示されます。pythonを使用した電子アプリはzmq.nodeエラーを投げます

Uncaught Error: Cannot find module '../build/Release/zmq.node' 
    at Module._resolveFilename (module.js:470:15) 
    at Function.Module._resolveFilename (/home/jad/Github/electron-python-example/node_modules/electron/dist/resources/electron.asar/common/reset-search-paths.js:35:12) 
    at Function.Module._load (module.js:418:25) 
    at Module.require (module.js:498:17) 
    at require (internal/module.js:20:19) 
    at Object.<anonymous> (/home/jad/Github/electron-python-example/node_modules/zeromq/lib/index.js:6:11) 
    at Object.<anonymous> (/home/jad/Github/electron-python-example/node_modules/zeromq/lib/index.js:839:3) 
    at Module._compile (module.js:571:32) 
    at Object.Module._extensions..js (module.js:580:10) 
    at Module.load (module.js:488:32) 

他の人がこの問題と、私は次のことを実行したときにthis SO answerがしかし、参照されているsolution was postedを持っていたことが判明。

npm install --save-dev electron-rebuild 
./node_modules/.bin/electron-rebuild 

次のエラーメッセージが表示されます。

An unhandled error occurred inside electron-rebuild 
gyp info it worked if it ends with ok 
gyp info using [email protected] 
gyp info using [email protected] | linux | x64 
gyp http GET https://atom.io/download/electron/v1.6.8/iojs-v1.6.8.tar.gz 
gyp http 200 https://atom.io/download/electron/v1.6.8/iojs-v1.6.8.tar.gz 
gyp http GET https://atom.io/download/electron/v1.6.8/SHASUMS256.txt 
gyp http 200 https://atom.io/download/electron/v1.6.8/SHASUMS256.txt 
gyp info spawn /usr/bin/python2 
gyp info spawn args [ '/home/jad/Github/electron-python-example/node_modules/node-gyp/gyp/gyp_main.py', 
gyp info spawn args 'binding.gyp', 
gyp info spawn args '-f', 
gyp info spawn args 'make', 
gyp info spawn args '-I', 
gyp info spawn args '/home/jad/Github/electron-python-example/node_modules/zeromq/build/config.gypi', 
gyp info spawn args '-I', 
gyp info spawn args '/home/jad/Github/electron-python-example/node_modules/node-gyp/addon.gypi', 
gyp info spawn args '-I', 
gyp info spawn args '/home/jad/.electron-gyp/.node-gyp/iojs-1.6.8/common.gypi', 
gyp info spawn args '-Dlibrary=shared_library', 
gyp info spawn args '-Dvisibility=default', 
gyp info spawn args '-Dnode_root_dir=/home/jad/.electron-gyp/.node-gyp/iojs-1.6.8', 
gyp info spawn args '-Dnode_gyp_dir=/home/jad/Github/electron-python-example/node_modules/node-gyp', 
gyp info spawn args '-Dnode_lib_file=iojs.lib', 
gyp info spawn args '-Dmodule_root_dir=/home/jad/Github/electron-python-example/node_modules/zeromq', 
gyp info spawn args '-Dnode_engine=v8', 
gyp info spawn args '--depth=.', 
gyp info spawn args '--no-parallel', 
gyp info spawn args '--generator-output', 
gyp info spawn args 'build', 
gyp info spawn args '-Goutput_dir=.' ] 
gyp info spawn make 
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ] 
make: Entering directory '/home/jad/Github/electron-python-example/node_modules/zeromq/build' 
    CXX(target) Release/obj.target/zmq/binding.o 
    SOLINK_MODULE(target) Release/obj.target/zmq.node 
g++: error: ./Release/../../zmq/lib/libzmq.a: No such file or directory 
zmq.target.mk:123: recipe for target 'Release/obj.target/zmq.node' failed 
make: Leaving directory '/home/jad/Github/electron-python-example/node_modules/zeromq/build' 
make: *** [Release/obj.target/zmq.node] Error 1 
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2 
gyp ERR! stack  at ChildProcess.onExit (/home/jad/Github/electron-python-example/node_modules/node-gyp/lib/build.js:285:23) 
gyp ERR! stack  at emitTwo (events.js:106:13) 
gyp ERR! stack  at ChildProcess.emit (events.js:194:7) 
gyp ERR! stack  at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12) 
gyp ERR! System Linux 4.4.0-78-generic 
gyp ERR! command "/usr/local/bin/node" "/home/jad/Github/electron-python-example/node_modules/.bin/node-gyp" "rebuild" "--target=1.6.8" "--arch=x64" "--dist-url=https://atom.io/download/electron" "--build-from-source" 
gyp ERR! cwd /home/jad/Github/electron-python-example/node_modules/zeromq 
gyp ERR! node -v v7.10.0 
gyp ERR! node-gyp -v v3.6.1 
gyp ERR! not ok 

Failed with exit code: 1 

Error: gyp info it worked if it ends with ok 
gyp info using [email protected] 
gyp info using [email protected] | linux | x64 
gyp http GET https://atom.io/download/electron/v1.6.8/iojs-v1.6.8.tar.gz 
gyp http 200 https://atom.io/download/electron/v1.6.8/iojs-v1.6.8.tar.gz 
gyp http GET https://atom.io/download/electron/v1.6.8/SHASUMS256.txt 
gyp http 200 https://atom.io/download/electron/v1.6.8/SHASUMS256.txt 
gyp info spawn /usr/bin/python2 
gyp info spawn args [ '/home/jad/Github/electron-python-example/node_modules/node-gyp/gyp/gyp_main.py', 
gyp info spawn args 'binding.gyp', 
gyp info spawn args '-f', 
gyp info spawn args 'make', 
gyp info spawn args '-I', 
gyp info spawn args '/home/jad/Github/electron-python-example/node_modules/zeromq/build/config.gypi', 
gyp info spawn args '-I', 
gyp info spawn args '/home/jad/Github/electron-python-example/node_modules/node-gyp/addon.gypi', 
gyp info spawn args '-I', 
gyp info spawn args '/home/jad/.electron-gyp/.node-gyp/iojs-1.6.8/common.gypi', 
gyp info spawn args '-Dlibrary=shared_library', 
gyp info spawn args '-Dvisibility=default', 
gyp info spawn args '-Dnode_root_dir=/home/jad/.electron-gyp/.node-gyp/iojs-1.6.8', 
gyp info spawn args '-Dnode_gyp_dir=/home/jad/Github/electron-python-example/node_modules/node-gyp', 
gyp info spawn args '-Dnode_lib_file=iojs.lib', 
gyp info spawn args '-Dmodule_root_dir=/home/jad/Github/electron-python-example/node_modules/zeromq', 
gyp info spawn args '-Dnode_engine=v8', 
gyp info spawn args '--depth=.', 
gyp info spawn args '--no-parallel', 
gyp info spawn args '--generator-output', 
gyp info spawn args 'build', 
gyp info spawn args '-Goutput_dir=.' ] 
gyp info spawn make 
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ] 
make: Entering directory '/home/jad/Github/electron-python-example/node_modules/zeromq/build' 
    CXX(target) Release/obj.target/zmq/binding.o 
    SOLINK_MODULE(target) Release/obj.target/zmq.node 
g++: error: ./Release/../../zmq/lib/libzmq.a: No such file or directory 
zmq.target.mk:123: recipe for target 'Release/obj.target/zmq.node' failed 
make: Leaving directory '/home/jad/Github/electron-python-example/node_modules/zeromq/build' 
make: *** [Release/obj.target/zmq.node] Error 1 
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2 
gyp ERR! stack  at ChildProcess.onExit (/home/jad/Github/electron-python-example/node_modules/node-gyp/lib/build.js:285:23) 
gyp ERR! stack  at emitTwo (events.js:106:13) 
gyp ERR! stack  at ChildProcess.emit (events.js:194:7) 
gyp ERR! stack  at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12) 
gyp ERR! System Linux 4.4.0-78-generic 
gyp ERR! command "/usr/local/bin/node" "/home/jad/Github/electron-python-example/node_modules/.bin/node-gyp" "rebuild" "--target=1.6.8" "--arch=x64" "--dist-url=https://atom.io/download/electron" "--build-from-source" 
gyp ERR! cwd /home/jad/Github/electron-python-example/node_modules/zeromq 
gyp ERR! node -v v7.10.0 
gyp ERR! node-gyp -v v3.6.1 
gyp ERR! not ok 

Failed with exit code: 1 
    at SafeSubscriber._error (/home/jad/Github/electron-python-example/node_modules/spawn-rx/lib/src/index.js:262:84) 
    at SafeSubscriber.__tryOrUnsub (/home/jad/Github/electron-python-example/node_modules/rxjs/Subscriber.js:238:16) 
    at SafeSubscriber.error (/home/jad/Github/electron-python-example/node_modules/rxjs/Subscriber.js:197:26) 
    at Subscriber._error (/home/jad/Github/electron-python-example/node_modules/rxjs/Subscriber.js:128:26) 
    at Subscriber.error (/home/jad/Github/electron-python-example/node_modules/rxjs/Subscriber.js:102:18) 
    at MapSubscriber.Subscriber._error (/home/jad/Github/electron-python-example/node_modules/rxjs/Subscriber.js:128:26) 
    at MapSubscriber.Subscriber.error (/home/jad/Github/electron-python-example/node_modules/rxjs/Subscriber.js:102:18) 
    at SafeSubscriber._next (/home/jad/Github/electron-python-example/node_modules/spawn-rx/lib/src/index.js:236:65) 
    at SafeSubscriber.__tryOrSetError (/home/jad/Github/electron-python-example/node_modules/rxjs/Subscriber.js:247:16) 
    at SafeSubscriber.next (/home/jad/Github/electron-python-example/node_modules/rxjs/Subscriber.js:187:27) 

この問題を解決する方法はありますか?

答えて

3

私は私の解決策は、すべての情報here

実行 npm start

前にこのnpm rebuild zeromq --runtime=electron --target=1.6.2を(あなたはバージョンだ)を使用して、同じ問題を抱えていました

関連する問題