2

Full disclosure I'm a node/npm/electron noob but I'm attempting to build an electron app to interface with an existing python module I wrote and I came across this Github repo. So I cloned it and I'm trying to run it from linux mint cinnamon version 3.2.7. The electron app starts however the python component doesn't work. When I open the developer tools the console displays this error message;

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)

Turns out that others have had this problem and a solution was posted where this SO answer is referenced however when I run the following;

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

I get the following error messages;

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)

Is there any way that I get fix/get-around this issue?

1 Answer 1

5

i had same problem, my solution was using this npm rebuild zeromq --runtime=electron --target=1.6.2(you're version) before run npm start

All info here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.