cryptlex/lexactivator-js

Electron Forge run error `library not found for -lLexActivator `

Closed this issue · 8 comments

post yarn add @cryptlex/lexactivator --target_arch=x64 --target_platform=darwin --target_libc=unknown not able to run application :(

An unhandled error has occurred inside Forge:
gyp info it worked if it ends with ok
gyp info using node-gyp@6.1.0
gyp info using node@12.16.1 | darwin | x64
gyp info find Python using Python version 2.7.16 found at "/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python"
gyp info spawn /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
gyp info spawn args [
gyp info spawn args   '/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/@electron-forge/core/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   '/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/@cryptlex/lexactivator/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/@electron-forge/core/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/smt-pro/.electron-gyp/9.2.1/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/smt-pro/.electron-gyp/9.2.1',
gyp info spawn args   '-Dnode_gyp_dir=/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/@electron-forge/core/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/smt-pro/.electron-gyp/9.2.1/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/@cryptlex/lexactivator',
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 args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  CC(target) Release/obj.target/nothing/../../node-addon-api/src/nothing.o
  LIBTOOL-STATIC Release/nothing.a
warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: archive library: Release/nothing.a the table of contents is empty (no object file members in the library define global symbols)
  CXX(target) Release/obj.target/lexactivator/src/main.o
  SOLINK_MODULE(target) Release/lexactivator.node
ld: library not found for -lLexActivator
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Release/lexactivator.node] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/@electron-forge/core/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:311:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 19.6.0
gyp ERR! command "/usr/local/bin/node" "/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/@electron-forge/core/node_modules/electron-rebuild/node_modules/.bin/node-gyp" "rebuild" "--target=9.2.1" "--arch=x64" "--dist-url=https://www.electronjs.org/headers" "--build-from-source" "--module_name=lexactivator" "--module_path=/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/@cryptlex/lexactivator/lib/binding/darwin-x64-napi-v{napi_build_version}-unknown" "--host=https://dl.cryptlex.com" "--remote_path=./downloads/nodejs/lexactivator/v3.12.3/" "--package_name=lexactivator-darwin-x64-napi-v{napi_build_version}-unknown.tar.gz"
gyp ERR! cwd /Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/@cryptlex/lexactivator
gyp ERR! node -v v12.16.1
gyp ERR! node-gyp -v v6.1.0
gyp ERR! not ok 

Failed with exit code: 1
Error: gyp info it worked if it ends with ok
gyp info using node-gyp@6.1.0
gyp info using node@12.16.1 | darwin | x64
gyp info find Python using Python version 2.7.16 found at "/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python"
gyp info spawn /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
gyp info spawn args [
gyp info spawn args   '/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/@electron-forge/core/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   '/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/@cryptlex/lexactivator/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/@electron-forge/core/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/smt-pro/.electron-gyp/9.2.1/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/smt-pro/.electron-gyp/9.2.1',
gyp info spawn args   '-Dnode_gyp_dir=/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/@electron-forge/core/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/smt-pro/.electron-gyp/9.2.1/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/@cryptlex/lexactivator',
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 args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  CC(target) Release/obj.target/nothing/../../node-addon-api/src/nothing.o
  LIBTOOL-STATIC Release/nothing.a
warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: archive library: Release/nothing.a the table of contents is empty (no object file members in the library define global symbols)
  CXX(target) Release/obj.target/lexactivator/src/main.o
  SOLINK_MODULE(target) Release/lexactivator.node
ld: library not found for -lLexActivator
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Release/lexactivator.node] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/@electron-forge/core/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:311:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 19.6.0
gyp ERR! command "/usr/local/bin/node" "/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/@electron-forge/core/node_modules/electron-rebuild/node_modules/.bin/node-gyp" "rebuild" "--target=9.2.1" "--arch=x64" "--dist-url=https://www.electronjs.org/headers" "--build-from-source" "--module_name=lexactivator" "--module_path=/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/@cryptlex/lexactivator/lib/binding/darwin-x64-napi-v{napi_build_version}-unknown" "--host=https://dl.cryptlex.com" "--remote_path=./downloads/nodejs/lexactivator/v3.12.3/" "--package_name=lexactivator-darwin-x64-napi-v{napi_build_version}-unknown.tar.gz"
gyp ERR! cwd /Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/@cryptlex/lexactivator
gyp ERR! node -v v12.16.1
gyp ERR! node-gyp -v v6.1.0
gyp ERR! not ok 

Failed with exit code: 1
    at SafeSubscriber._error (/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/spawn-rx/src/index.ts:296:18)
    at SafeSubscriber.__tryOrUnsub (/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/rxjs/src/internal/Subscriber.ts:265:10)
    at SafeSubscriber.error (/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/rxjs/src/internal/Subscriber.ts:220:16)
    at Subscriber._error (/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/rxjs/src/internal/Subscriber.ts:143:22)
    at Subscriber.error (/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/rxjs/src/internal/Subscriber.ts:113:12)
    at MapSubscriber.Subscriber._error (/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/rxjs/src/internal/Subscriber.ts:143:22)
    at MapSubscriber.Subscriber.error (/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/rxjs/src/internal/Subscriber.ts:113:12)
    at SafeSubscriber._next (/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/spawn-rx/src/index.ts:265:42)
    at SafeSubscriber.__tryOrUnsub (/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/rxjs/src/internal/Subscriber.ts:265:10)
    at SafeSubscriber.next (/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/rxjs/src/internal/Subscriber.ts:207:14)
    at Subscriber._next (/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/rxjs/src/internal/Subscriber.ts:139:22)
    at Subscriber.next (/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/rxjs/src/internal/Subscriber.ts:99:12)
    at DefaultIfEmptySubscriber._next (/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/rxjs/src/internal/operators/defaultIfEmpty.ts:75:22)
    at DefaultIfEmptySubscriber.Subscriber.next (/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/rxjs/src/internal/Subscriber.ts:99:12)
    at TakeLastSubscriber._complete (/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/rxjs/src/internal/operators/takeLast.ts:108:21)
    at TakeLastSubscriber.Subscriber.complete (/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/rxjs/src/internal/Subscriber.ts:126:12)
error Command failed with exit code 1.

Tried rebuilding with electron-rebuild

$ electron-rebuild -f -w @cryptlex/lexactivator
⠧ Building module: lexactivator, Completed: 0gyp info find Python using Python version 2.7.16 found at "/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python"
⠇ Building module: lexactivator, Completed: 0gyp info spawn /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
gyp info spawn args [
gyp info spawn args   '/Users/smt-pro/Projects/Brainwave/bws-app-v2/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   '/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/@cryptlex/lexactivator/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/@cryptlex/lexactivator/9.2.1/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/@cryptlex/lexactivator/9.2.1',
gyp info spawn args   '-Dnode_gyp_dir=/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/@cryptlex/lexactivator/9.2.1/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/@cryptlex/lexactivator',
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 args ]
⠸ Building module: lexactivator, Completed: 0gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  CC(target) Release/obj.target/nothing/../../node-addon-api/src/nothing.o
⠼ Building module: lexactivator, Completed: 0  LIBTOOL-STATIC Release/nothing.a
⠴ Building module: lexactivator, Completed: 0warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: archive library: Release/nothing.a the table of contents is empty (no object file members in the library define global symbols)
  CXX(target) Release/obj.target/lexactivator/src/main.o
⠴ Building module: lexactivator, Completed: 0  SOLINK_MODULE(target) Release/lexactivator.node
ld: library not found for -lLexActivator
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Release/lexactivator.node] Error 1
✖ Rebuild Failed

An unhandled error occurred inside electron-rebuild
node-gyp failed to rebuild '/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/@cryptlex/lexactivator'.
Error: `make` failed with exit code: 2



Error: node-gyp failed to rebuild '/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/@cryptlex/lexactivator'.
Error: `make` failed with exit code: 2


    at ModuleRebuilder.rebuildNodeGypModule (/Users/smt-pro/Projects/Brainwave/bws-app-v2/node_modules/electron-rebuild/lib/src/module-rebuilder.js:150:19)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
error Command failed with exit code 255.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I also run sample app it works for me as it's non electron project, however i can not see lib file there too.

image

Hi Sumeet,

Just try the following:

npm i @cryptlex/lexactivator

and see it works.

image

How can i use these ones?

You can't use these libs directly I guess. This works fine with electron-packager and we have customers using the same without any issues.

Need to check this out in case of electron-forge

Thanks, Do let me know solution for this. :)

Please try v3.14.8, the issue should be resolved now.