justmoon / node-bignum

Big integers for Node.js using OpenSSL
419 stars 116 forks source link

Installed node-bignum for my electron project. Got errors #116

Closed pc-magas closed 5 years ago

pc-magas commented 5 years ago

I installed the library to my electron project:

npm install bignum

But I get the following error when I start my application:

> custom_xmpp@1.0.0 start /home/pcmagas/Kwdikas/master_thesis/custom_xmpp
> NODE_ENV=dev ELECTRON_ENABLE_LOGGING=1 electron --inspect=5858 src/index.js

Debugger listening on ws://127.0.0.1:5858/bab095f6-6ece-4585-b05d-4990da8713cd
For help, see: https://nodejs.org/en/docs/inspector
/home/pcmagas/Kwdikas/master_thesis/custom_xmpp/node_modules/electron/dist/electron --inspect=5858 src/index.js: symbol lookup error: /home/pcmagas/Kwdikas/master_thesis/custom_xmpp/node_modules/bignum/build/Release/bignum.node: undefined symbol: _ZN2v816FunctionTemplate3NewEPNS_7IsolateEPFvRKNS_20FunctionCallbackInfoINS_5ValueEEEENS_5LocalIS4_EENSA_INS_9SignatureEEEiNS_19ConstructorBehaviorENS_14SideEffectTypeE
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! custom_xmpp@1.0.0 start: `NODE_ENV=dev ELECTRON_ENABLE_LOGGING=1 electron --inspect=5858 src/index.js`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the custom_xmpp@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Im also tried to rebuild it as seen into this issue I tried to my ubuntu machine having cd first to my project's folder:

 node-gyp rebuild --target=1.6.2 --openssl-root="/usr/bin/openssl" --arch=x64 --dist-url=https://atom.io/download/electron

And I got the following error:

gyp info it worked if it ends with ok
gyp info using node-gyp@3.0.3
gyp info using node@4.2.6 | linux | x64
gyp info spawn python2
gyp info spawn args [ '/usr/share/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/pcmagas/Kwdikas/master_thesis/custom_xmpp/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/share/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/pcmagas/.node-gyp/iojs-1.6.2/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/home/pcmagas/.node-gyp/iojs-1.6.2',
gyp info spawn args   '-Dnode_gyp_dir=/usr/share/node-gyp',
gyp info spawn args   '-Dnode_lib_file=iojs.lib',
gyp info spawn args   '-Dmodule_root_dir=/home/pcmagas/Kwdikas/master_thesis/custom_xmpp',
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: binding.gyp not found (cwd: /home/pcmagas/Kwdikas/master_thesis/custom_xmpp) while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:354:16)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 4.4.0-141-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/bin/node-gyp" "rebuild" "--target=1.6.2" "--openssl-root=/usr/bin/openssl" "--arch=x64" "--dist-url=https://atom.io/download/electron"
gyp ERR! cwd /home/pcmagas/Kwdikas/master_thesis/custom_xmpp
gyp ERR! node -v v4.2.6
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok 

Do you know how can recompile my depedency to my electron project so the lib can cooperate with electron?

pc-magas commented 5 years ago

As seen in this stackoverflow answer install electron-rebuild and use that utility to rebuild the library.