rebuild icon indicating copy to clipboard operation
rebuild copied to clipboard

electron-rebuild & sqlite3 failures on macOS 10.14.3 (current)

Open qcha0s opened this issue 6 years ago • 3 comments

node 11.3.0 electron 1.4.13 electron-rebuild 1.8.4 sqlite3 4.0.6

So I'm trying to get electron to play nice with sqlite3 (which needs to be rebuilt / whole separate PITA issue).

To do this I need to npm install electron-rebuild (which now needs me to npm electron-prebuilt as well? / whole separate PITA issue) and then run electron-rebuild -f -w sqlite3 . However electron-prebuilt is using gyp and for some un-forsaken reason gyp is looking for stdlibc++ (which has been deprecated in Xcode since version 10. - see https://github.com/nodejs/node/issues/24648#issuecomment-441486067

it's nice that gyp suggests that I add -std=libc++ on the command line however, I have no idea how I would pass -std=libc++ into gyp from an electron-rebuild call.

Any thoughts or a workaround would be greatly appreciated.

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] | darwin | x64
gyp info spawn /usr/local/bin/python2
gyp info spawn args [ '/Users/USER/PATHTOPROJECT/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/USER/PATHTOPROJECT/node_modules/sqlite3/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/USER/PATHTOPROJECT/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/USER/.electron-gyp/iojs-1.4.13/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/USER/.electron-gyp/iojs-1.4.13',
gyp info spawn args   '-Dnode_gyp_dir=/Users/USER/PATHTOPROJECT/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/USER/.electron-gyp/iojs-1.4.13/<(target_arch)/iojs.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/USER/PATHTOPROJECT/node_modules/sqlite3',
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' ]
  ACTION deps_sqlite3_gyp_action_before_build_target_unpack_sqlite_dep Release/obj/gen/sqlite-autoconf-3260000/sqlite3.c
  TOUCH Release/obj.target/deps/action_before_build.stamp
  CC(target) Release/obj.target/sqlite3/gen/sqlite-autoconf-3260000/sqlite3.o
  LIBTOOL-STATIC Release/sqlite3.a
  CXX(target) Release/obj.target/node_sqlite3/src/database.o
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
In file included from ../src/database.cc:4:
../src/database.h:6:10: fatal error: 'string' file not found
#include <string>
         ^~~~~~~~
1 warning and 1 error generated.
make: *** [Release/obj.target/node_sqlite3/src/database.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2 ... blah blah blah blah ... 

qcha0s avatar Feb 14 '19 00:02 qcha0s

Have a similar problem that is preventing me from building an app. Let me know how I can help solve this issue

These links may help: https://stackoverflow.com/questions/51060596/ld-library-not-found-for-lstdc-

adamlucia avatar Jul 02 '19 17:07 adamlucia

Same problem

sshaplygin avatar Dec 15 '19 20:12 sshaplygin

Same issue here, sqlite3 works fine with nodejs but electron cannot find sqlite3 module.

Error: Cannot find module
'.../node_modules/sqlite3/lib/binding/napi-v6-darwin-x64/node_sqlite3.node'

tried many ways, (i.e., to rebuild node_sqlite3) and all failed.

gyp: Undefined variable napi_build_version in binding.gyp while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1

macOS BigSur ❯ npm --version 7.5.2 ❯ node -v v10.15.1

i-chaochen avatar Feb 05 '21 00:02 i-chaochen