WiseLibs/better-sqlite3

Help me use Electron!

Opened this issue · 181 comments

Electron Help Thread

This thread is for anyone who needs help using Electron with better-sqlite3.

better-sqlite3 is a Node.js package, not an Electron package. If third parties like Electron decide to do fancy things that happen to break a perfectly functioning Node.js package, it is not an issue with that package. Any issues related to Electron should be reported here. If you're lucky, friendly members of the community may chime in here to help you.

@m4heshd thanks a lot! actually, electron-rebuild worked for me, and since this is a personal project and not production material I will just stay with it, don't have the power to start configuring electron-builder... but for the future, I will certainly keep it in mind
Really appreciate all the help!

I try to use better-sqlite3 7.1.1 in Electron 7.2.3 on a Raspberry Pi 3. It successfully compiles and rebuilds with electron-rebuild:

$(npm bin)/electron-rebuild -f -a arm -v 7.2.3 -w better-sqlite3

Unfortunately I get this error at runtime:

{
  constructor: 'Error',
  stack: 'Error: /usr/lib/node/better-sqlite3/build/Release/better_sqlite3.node: undefined symbol: _ZN2v82V813DisposeGlobalEPPNS_8internal6ObjectE\n' +
    '    at process.func (electron/js2c/asar.js:140:31)\n' +
    '    at process.func [as dlopen] (electron/js2c/asar.js:140:31)\n' +
    '    at Object.Module._extensions..node (internal/modules/cjs/loader.js:922:18)\n' +
    '    at Object.func (electron/js2c/asar.js:140:31)\n' +
    '    at Object.func [as .node] (electron/js2c/asar.js:140:31)\n' +
    '    at Module.load (internal/modules/cjs/loader.js:735:32)\n' +
    '    at Module._load (internal/modules/cjs/loader.js:648:12)\n' +
    '    at Module._load (electron/js2c/asar.js:717:26)\n' +
    '    at Function.Module._load (electron/js2c/asar.js:717:26)\n' +
    '    at Module.require (internal/modules/cjs/loader.js:775:19)'
}

Any idea what that means?

@cyrilfr You have to stop native addons like better-sqlite3 from being packed into the build asar. Use electron-builder with install-app-deps. Then try setting asar to false on electron-builder and see if it works. If then you can use asarUnpack to exclude only the addons you specify. I'm not 100% positive if that's the issue but never hurts to try.

@m4heshd I forgot to precise that it works on my x64 machine. I simply don't set the -a flag because the host and the target are the same machine. So I guess this is not related to the package format but more to an architecture specific issue, a node version mismatch or an issue with the lzz thing used for this module.

I want to replace the node-sqlite3 module that works on the RPi like other native modules.

The node version installed on my RPI is Node 10.17.0.

@cyrilfr Node version shouldn't matter since Electron carries its own Node ABI and all the native addons are compiled against that target. If the issue is architecture based, I still suggest using electron-builder with armv7l target arch. The error could also be OS related. Did you try completely removing the node_modules directory and reinstalling and building modules?

Thank you for your help, I really appreciate :)

I build everything with the OpenEmbedded project so each native node module is packaged separately in order to be compliant with the package manager (OPKG). It has a NPM support so all the modules are installed under /usr/lib/node on the target.

I tried to not use electron-rebuild:

npm install --save-dev node-gyp
$(npm bin)/node-gyp rebuild --release --target=7.2.3 --arch=armv7l --dist-url=https://electronjs.org/headers

but unfortunately I get a similar error message:

{
  constructor: 'Error',
  name: 'UnhandledRejection Error',
  stack: 'UnhandledRejection Error: Error: /usr/lib/node/better-sqlite3/build/Release/better_sqlite3.node: undefined symbol: _ZN2v82V813DisposeGlobalEPPNS_8internal6ObjectE\n' +
    '    at BetterSqlite3Driver.loadDependencies (/usr/lib/node/typeorm/driver/better-sqlite3/BetterSqlite3Driver.js:105:19)\n' +
    '    at new BetterSqlite3Driver (/usr/lib/node/typeorm/driver/better-sqlite3/BetterSqlite3Driver.js:28:15)\n' +
    '    at DriverFactory.create (/usr/lib/node/typeorm/driver/DriverFactory.js:45:24)\n' +
    '    at new Connection (/usr/lib/node/typeorm/connection/Connection.js:53:59)\n' +
    '    at ConnectionManager.create (/usr/lib/node/typeorm/connection/ConnectionManager.js:56:26)\n' +
    '    at Object.<anonymous> (/usr/lib/node/typeorm/index.js:195:66)\n' +
    '    at step (/usr/lib/node/typeorm/node_modules/tslib/tslib.js:141:27)\n' +
    '    at Object.next (/usr/lib/node/typeorm/node_modules/tslib/tslib.js:122:57)\n' +
    '    at /usr/lib/node/typeorm/node_modules/tslib/tslib.js:115:75\n' +
    '    at new Promise (<anonymous>)'
}

@cyrilfr This could likely be an issue with the platform. Check this. Or it could be an issue with the Node ABI used in the particular version of Electron you're using. Check this issue.

The best way to diagnose this is to change variables one by one. Mirror all the dependency versions on a slightly different platform. If it works there, it's most definitely an issue with platform. If it doesn't work there, you're gonna have to upgrade/downgrade each dependency and check each alteration on at least two platforms. Painful but can't think of a more effective solution. Best of luck.

I added this line to the binding.gyp file as recommended in the first issue you reference:

  'ldflags': ['-Wl,-z,defs'],
# ===
# This is the main GYP file, which builds better-sqlite3 with SQLite3 itself.
# ===

{
  'includes': ['deps/common.gypi'],
  'targets': [
    {
      'target_name': 'better_sqlite3',
      'dependencies': ['deps/sqlite3.gyp:sqlite3'],
      'sources': ['src/better_sqlite3.cpp'],
      'cflags': ['-std=c++11'],
      'ldflags': ['-Wl,-z,defs'],
      'xcode_settings': {
        'OTHER_CPLUSPLUSFLAGS': ['-std=c++11', '-stdlib=libc++'],
      },
    },
    {
      'target_name': 'test_extension',
      'dependencies': ['deps/sqlite3.gyp:sqlite3'],
      'conditions': [['sqlite3 == ""', { 'sources': ['deps/test_extension.c'] }]],
    },
  ],
}

I now get an error at compile time.

DEBUG: Executing shell function do_compile
npm WARN using --force I sure hope you know what you are doing.
npm WARN deprecated debug@3.2.6: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated fsevents@2.1.3: "Please update to latest v2.3 or v2.2"
npm WARN deprecated node-pre-gyp@0.11.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported

> better-sqlite3@7.1.1 install /home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/npmpkg
> prebuild-install || npm run build-release


> better-sqlite3@7.1.1 build-release /home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/npmpkg
> node-gyp rebuild --release

make: Entering directory '/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/npmpkg/build'
  TOUCH b857c92884e9598d609f6be182a2595df7a8e00f.intermediate
  ACTION deps_sqlite3_gyp_locate_sqlite3_target_extract_sqlite3 b857c92884e9598d609f6be182a2595df7a8e00f.intermediate
  TOUCH Release/obj.target/deps/locate_sqlite3.stamp
  CC(target) Release/obj.target/sqlite3/gen/sqlite3/sqlite3.o
  AR(target) Release/obj.target/deps/sqlite3.a
  COPY Release/sqlite3.a
  CXX(target) Release/obj.target/better_sqlite3/src/better_sqlite3.o
In file included from ./src/better_sqlite3.lzz:10,
                 from ../src/better_sqlite3.cpp:4:
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/.cache/node-gyp/10.17.0/include/node/node.h:593:51: warning: cast between incompatible function types from 'void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, v8::Local<v8::Context>)' to 'node::addon_context_register_func' {aka 'void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, v8::Local<v8::Context>, void*)'} [-Wcast-function-type]
       (node::addon_context_register_func) (regfunc),                  \
                                                   ^
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/.cache/node-gyp/10.17.0/include/node/node.h:611:3: note: in expansion of macro 'NODE_MODULE_CONTEXT_AWARE_X'
   NODE_MODULE_CONTEXT_AWARE_X(modname, regfunc, NULL, 0)
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/.cache/node-gyp/10.17.0/include/node/node.h:634:3: note: in expansion of macro 'NODE_MODULE_CONTEXT_AWARE'
   NODE_MODULE_CONTEXT_AWARE(NODE_GYP_MODULE_NAME,                     \
   ^~~~~~~~~~~~~~~~~~~~~~~~~
./src/better_sqlite3.lzz:67:1: note: in expansion of macro 'NODE_MODULE_INIT'
./src/objects/database.lzz: In static member function 'static void Database::JS_new(const v8::FunctionCallbackInfo<v8::Value>&)':
./src/objects/database.lzz:172:21: warning: variable 'status' set but not used [-Wunused-but-set-variable]
In file included from /home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/.cache/node-gyp/10.17.0/include/node/node.h:63,
                 from ./src/better_sqlite3.lzz:10,
                 from ../src/better_sqlite3.cpp:4:
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/.cache/node-gyp/10.17.0/include/node/v8.h: In instantiation of 'void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = node::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)]':
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/.cache/node-gyp/10.17.0/include/node/node_object_wrap.h:84:78:   required from here
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/.cache/node-gyp/10.17.0/include/node/v8.h:9502:16: warning: cast between incompatible function types from 'v8::WeakCallbackInfo<node::ObjectWrap>::Callback' {aka 'void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)'} to 'Callback' {aka 'void (*)(const v8::WeakCallbackInfo<void>&)'} [-Wcast-function-type]
                reinterpret_cast<Callback>(callback), type);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./src/util/data.lzz: In function 'v8::Local<v8::Value> Data::GetValueJS(v8::Isolate*, sqlite3_stmt*, int, bool)':
./src/util/data.lzz:75:92: warning: this statement may fall through [-Wimplicit-fallthrough=]
./src/util/data.lzz:75:197: note: here
./src/util/data.lzz: In function 'v8::Local<v8::Value> Data::GetValueJS(v8::Isolate*, sqlite3_value*, bool)':
./src/util/data.lzz:79:81: warning: this statement may fall through [-Wimplicit-fallthrough=]
./src/util/data.lzz:79:175: note: here
  SOLINK_MODULE(target) Release/obj.target/better_sqlite3.node
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `CustomFunction::~CustomFunction()':
/usr/src/debug/better-sqlite3/7.1.1-r0/.cache/node-gyp/10.17.0/include/node/v8.h:9469: undefined reference to `v8::V8::DisposeGlobal(v8::internal::Object**)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `Statement::JS_iterate(v8::FunctionCallbackInfo<v8::Value> const&)':
/usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/objects/statement.lzz:199: undefined reference to `v8::External::Value() const'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `Statement::JS_iterate(v8::FunctionCallbackInfo<v8::Value> const&)':
/usr/src/debug/better-sqlite3/7.1.1-r0/.cache/node-gyp/10.17.0/include/node/v8.h:9378: undefined reference to `v8::HandleScope::CreateHandle(v8::internal::Isolate*, v8::internal::Object*)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `Statement::JS_iterate(v8::FunctionCallbackInfo<v8::Value> const&)':
/usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/objects/statement.lzz:203: undefined reference to `v8::Isolate::GetCurrentContext()'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: /usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/objects/statement.lzz:203: undefined reference to `v8::Function::NewInstance(v8::Local<v8::Context>, int, v8::Local<v8::Value>*) const'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `StatementIterator::~StatementIterator()':
/usr/src/debug/better-sqlite3/7.1.1-r0/.cache/node-gyp/10.17.0/include/node/v8.h:9514: undefined reference to `v8::V8::ClearWeak(v8::internal::Object**)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: /usr/src/debug/better-sqlite3/7.1.1-r0/.cache/node-gyp/10.17.0/include/node/v8.h:9469: undefined reference to `v8::V8::DisposeGlobal(v8::internal::Object**)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `ThrowError(char const*)':
/usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/util/macros.lzz:37: undefined reference to `v8::Isolate::GetCurrent()'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `StringFromUtf8(v8::Isolate*, char const*, int)':
/usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/util/macros.lzz:17: undefined reference to `v8::String::NewFromUtf8(v8::Isolate*, char const*, v8::NewStringType, int)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `ThrowError(char const*)':
/usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/util/macros.lzz:37: undefined reference to `v8::Exception::Error(v8::Local<v8::String>)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `ThrowError(char const*)':
/usr/src/debug/better-sqlite3/7.1.1-r0/.cache/node-gyp/10.17.0/include/node/v8.h:9401: undefined reference to `v8::V8::ToLocalEmpty()'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `ThrowTypeError(char const*)':
/usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/util/macros.lzz:38: undefined reference to `v8::Isolate::GetCurrent()'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `StringFromUtf8(v8::Isolate*, char const*, int)':
/usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/util/macros.lzz:17: undefined reference to `v8::String::NewFromUtf8(v8::Isolate*, char const*, v8::NewStringType, int)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `ThrowTypeError(char const*)':
/usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/util/macros.lzz:38: undefined reference to `v8::Exception::TypeError(v8::Local<v8::String>)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `ThrowTypeError(char const*)':
/usr/src/debug/better-sqlite3/7.1.1-r0/.cache/node-gyp/10.17.0/include/node/v8.h:9401: undefined reference to `v8::V8::ToLocalEmpty()'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `Database::JS_pragma(v8::FunctionCallbackInfo<v8::Value> const&)':
/usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/objects/database.lzz:239: undefined reference to `v8::Value::IsBoolean() const'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: /usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/objects/database.lzz:239: undefined reference to `v8::Boolean::Value() const'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: /usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/objects/database.lzz:240: undefined reference to `v8::External::Value() const'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `Database::JS_prepare(v8::FunctionCallbackInfo<v8::Value> const&)':
/usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/objects/database.lzz:190: undefined reference to `v8::External::Value() const'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `Database::JS_prepare(v8::FunctionCallbackInfo<v8::Value> const&)':
/usr/src/debug/better-sqlite3/7.1.1-r0/.cache/node-gyp/10.17.0/include/node/v8.h:9378: undefined reference to `v8::HandleScope::CreateHandle(v8::internal::Isolate*, v8::internal::Object*)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `Database::JS_prepare(v8::FunctionCallbackInfo<v8::Value> const&)':
/usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/objects/database.lzz:194: undefined reference to `v8::Isolate::GetCurrentContext()'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: /usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/objects/database.lzz:194: undefined reference to `v8::Function::NewInstance(v8::Local<v8::Context>, int, v8::Local<v8::Value>*) const'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `Database::JS_backup(v8::FunctionCallbackInfo<v8::Value> const&)':
/usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/objects/database.lzz:246: undefined reference to `v8::Value::IsBoolean() const'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: /usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/objects/database.lzz:246: undefined reference to `v8::Boolean::Value() const'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: /usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/objects/database.lzz:250: undefined reference to `v8::External::Value() const'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `Database::JS_backup(v8::FunctionCallbackInfo<v8::Value> const&)':
/usr/src/debug/better-sqlite3/7.1.1-r0/.cache/node-gyp/10.17.0/include/node/v8.h:9378: undefined reference to `v8::HandleScope::CreateHandle(v8::internal::Isolate*, v8::internal::Object*)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `Database::JS_backup(v8::FunctionCallbackInfo<v8::Value> const&)':
/usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/objects/database.lzz:254: undefined reference to `v8::Isolate::GetCurrentContext()'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: /usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/objects/database.lzz:254: undefined reference to `v8::Function::NewInstance(v8::Local<v8::Context>, int, v8::Local<v8::Value>*) const'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `Addon::JS_setErrorConstructor(v8::FunctionCallbackInfo<v8::Value> const&)':
/usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/better_sqlite3.lzz:44: undefined reference to `v8::Value::IsFunction() const'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: /usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/better_sqlite3.lzz:45: undefined reference to `v8::External::Value() const'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `Addon::JS_setErrorConstructor(v8::FunctionCallbackInfo<v8::Value> const&)':
/usr/src/debug/better-sqlite3/7.1.1-r0/.cache/node-gyp/10.17.0/include/node/v8.h:9469: undefined reference to `v8::V8::DisposeGlobal(v8::internal::Object**)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: /usr/src/debug/better-sqlite3/7.1.1-r0/.cache/node-gyp/10.17.0/include/node/v8.h:9422: undefined reference to `v8::V8::GlobalizeReference(v8::internal::Isolate*, v8::internal::Object**)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `ThrowRangeError(char const*)':
/usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/util/macros.lzz:39: undefined reference to `v8::Isolate::GetCurrent()'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `StringFromUtf8(v8::Isolate*, char const*, int)':
/usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/util/macros.lzz:17: undefined reference to `v8::String::NewFromUtf8(v8::Isolate*, char const*, v8::NewStringType, int)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `ThrowRangeError(char const*)':
/usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/util/macros.lzz:39: undefined reference to `v8::Exception::RangeError(v8::Local<v8::String>)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `ThrowRangeError(char const*)':
/usr/src/debug/better-sqlite3/7.1.1-r0/.cache/node-gyp/10.17.0/include/node/v8.h:9401: undefined reference to `v8::V8::ToLocalEmpty()'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `Database::JS_open(v8::Local<v8::String>, v8::PropertyCallbackInfo<v8::Value> const&)':
/usr/src/debug/better-sqlite3/7.1.1-r0/.cache/node-gyp/10.17.0/include/node/v8.h:9901: undefined reference to `v8::Object::SlowGetAlignedPointerFromInternalField(int)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `Database::JS_inTransaction(v8::Local<v8::String>, v8::PropertyCallbackInfo<v8::Value> const&)':
/usr/src/debug/better-sqlite3/7.1.1-r0/.cache/node-gyp/10.17.0/include/node/v8.h:9901: undefined reference to `v8::Object::SlowGetAlignedPointerFromInternalField(int)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `Statement::JS_columns(v8::FunctionCallbackInfo<v8::Value> const&)':
/usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/objects/statement.lzz:268: undefined reference to `v8::Isolate::GetCurrentContext()'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: /usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/objects/statement.lzz:271: undefined reference to `v8::Array::New(v8::Isolate*, int)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `Statement::JS_columns(v8::FunctionCallbackInfo<v8::Value> const&)':
/usr/src/debug/better-sqlite3/7.1.1-r0/.cache/node-gyp/10.17.0/include/node/v8.h:9378: undefined reference to `v8::HandleScope::CreateHandle(v8::internal::Isolate*, v8::internal::Object*)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: /usr/src/debug/better-sqlite3/7.1.1-r0/.cache/node-gyp/10.17.0/include/node/v8.h:9378: undefined reference to `v8::HandleScope::CreateHandle(v8::internal::Isolate*, v8::internal::Object*)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: /usr/src/debug/better-sqlite3/7.1.1-r0/.cache/node-gyp/10.17.0/include/node/v8.h:9378: undefined reference to `v8::HandleScope::CreateHandle(v8::internal::Isolate*, v8::internal::Object*)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: /usr/src/debug/better-sqlite3/7.1.1-r0/.cache/node-gyp/10.17.0/include/node/v8.h:9378: undefined reference to `v8::HandleScope::CreateHandle(v8::internal::Isolate*, v8::internal::Object*)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: /usr/src/debug/better-sqlite3/7.1.1-r0/.cache/node-gyp/10.17.0/include/node/v8.h:9378: undefined reference to `v8::HandleScope::CreateHandle(v8::internal::Isolate*, v8::internal::Object*)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `Statement::JS_columns(v8::FunctionCallbackInfo<v8::Value> const&)':
/usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/objects/statement.lzz:280: undefined reference to `v8::Object::New(v8::Isolate*)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `InternalizedFromUtf8(v8::Isolate*, char const*, int)':
/usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/util/macros.lzz:20: undefined reference to `v8::String::NewFromUtf8(v8::Isolate*, char const*, v8::NewStringType, int)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `Statement::JS_columns(v8::FunctionCallbackInfo<v8::Value> const&)':
/usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/objects/statement.lzz:284: undefined reference to `v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `InternalizedFromUtf8(v8::Isolate*, char const*, int)':
/usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/util/macros.lzz:20: undefined reference to `v8::String::NewFromUtf8(v8::Isolate*, char const*, v8::NewStringType, int)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `Statement::JS_columns(v8::FunctionCallbackInfo<v8::Value> const&)':
/usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/objects/statement.lzz:287: undefined reference to `v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `InternalizedFromUtf8(v8::Isolate*, char const*, int)':
/usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/util/macros.lzz:20: undefined reference to `v8::String::NewFromUtf8(v8::Isolate*, char const*, v8::NewStringType, int)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `Statement::JS_columns(v8::FunctionCallbackInfo<v8::Value> const&)':
/usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/objects/statement.lzz:290: undefined reference to `v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `InternalizedFromUtf8(v8::Isolate*, char const*, int)':
/usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/util/macros.lzz:20: undefined reference to `v8::String::NewFromUtf8(v8::Isolate*, char const*, v8::NewStringType, int)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `Statement::JS_columns(v8::FunctionCallbackInfo<v8::Value> const&)':
/usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/objects/statement.lzz:293: undefined reference to `v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `InternalizedFromUtf8(v8::Isolate*, char const*, int)':
/usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/util/macros.lzz:20: undefined reference to `v8::String::NewFromUtf8(v8::Isolate*, char const*, v8::NewStringType, int)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `Statement::JS_columns(v8::FunctionCallbackInfo<v8::Value> const&)':
/usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/objects/statement.lzz:296: undefined reference to `v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: /usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/objects/statement.lzz:298: undefined reference to `v8::Object::Set(v8::Local<v8::Context>, unsigned int, v8::Local<v8::Value>)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `Statement::JS_columns(v8::FunctionCallbackInfo<v8::Value> const&)':
/usr/src/debug/better-sqlite3/7.1.1-r0/.cache/node-gyp/10.17.0/include/node/v8.h:8452: undefined reference to `v8::V8::FromJustIsNothing()'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: /usr/src/debug/better-sqlite3/7.1.1-r0/.cache/node-gyp/10.17.0/include/node/v8.h:8452: undefined reference to `v8::V8::FromJustIsNothing()'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: /usr/src/debug/better-sqlite3/7.1.1-r0/.cache/node-gyp/10.17.0/include/node/v8.h:8452: undefined reference to `v8::V8::FromJustIsNothing()'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: /usr/src/debug/better-sqlite3/7.1.1-r0/.cache/node-gyp/10.17.0/include/node/v8.h:8452: undefined reference to `v8::V8::FromJustIsNothing()'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: /usr/src/debug/better-sqlite3/7.1.1-r0/.cache/node-gyp/10.17.0/include/node/v8.h:8452: undefined reference to `v8::V8::FromJustIsNothing()'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o:/usr/src/debug/better-sqlite3/7.1.1-r0/.cache/node-gyp/10.17.0/include/node/v8.h:8452: more undefined references to `v8::V8::FromJustIsNothing()' follow
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `Statement::JS_columns(v8::FunctionCallbackInfo<v8::Value> const&)':
/usr/src/debug/better-sqlite3/7.1.1-r0/.cache/node-gyp/10.17.0/include/node/v8.h:9401: undefined reference to `v8::V8::ToLocalEmpty()'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: /usr/src/debug/better-sqlite3/7.1.1-r0/.cache/node-gyp/10.17.0/include/node/v8.h:9401: undefined reference to `v8::V8::ToLocalEmpty()'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: /usr/src/debug/better-sqlite3/7.1.1-r0/.cache/node-gyp/10.17.0/include/node/v8.h:9401: undefined reference to `v8::V8::ToLocalEmpty()'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: /usr/src/debug/better-sqlite3/7.1.1-r0/.cache/node-gyp/10.17.0/include/node/v8.h:9401: undefined reference to `v8::V8::ToLocalEmpty()'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: /usr/src/debug/better-sqlite3/7.1.1-r0/.cache/node-gyp/10.17.0/include/node/v8.h:9401: undefined reference to `v8::V8::ToLocalEmpty()'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: /usr/src/debug/better-sqlite3/7.1.1-r0/.cache/node-gyp/10.17.0/include/node/v8.h:9901: undefined reference to `v8::Object::SlowGetAlignedPointerFromInternalField(int)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `Statement::JS_safeIntegers(v8::FunctionCallbackInfo<v8::Value> const&)':
/usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/objects/statement.lzz:257: undefined reference to `v8::Value::IsBoolean() const'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: /usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/objects/statement.lzz:257: undefined reference to `v8::Boolean::Value() const'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `Statement::JS_safeIntegers(v8::FunctionCallbackInfo<v8::Value> const&)':
/usr/src/debug/better-sqlite3/7.1.1-r0/.cache/node-gyp/10.17.0/include/node/v8.h:9901: undefined reference to `v8::Object::SlowGetAlignedPointerFromInternalField(int)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `Database::JS_defaultSafeIntegers(v8::FunctionCallbackInfo<v8::Value> const&)':
/usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/objects/database.lzz:343: undefined reference to `v8::Value::IsBoolean() const'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: /usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/objects/database.lzz:343: undefined reference to `v8::Boolean::Value() const'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `Database::JS_defaultSafeIntegers(v8::FunctionCallbackInfo<v8::Value> const&)':
/usr/src/debug/better-sqlite3/7.1.1-r0/.cache/node-gyp/10.17.0/include/node/v8.h:9901: undefined reference to `v8::Object::SlowGetAlignedPointerFromInternalField(int)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `Statement::JS_pluck(v8::FunctionCallbackInfo<v8::Value> const&)':
/usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/objects/statement.lzz:225: undefined reference to `v8::Value::IsBoolean() const'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: /usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/objects/statement.lzz:225: undefined reference to `v8::Boolean::Value() const'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `Statement::JS_pluck(v8::FunctionCallbackInfo<v8::Value> const&)':
/usr/src/debug/better-sqlite3/7.1.1-r0/.cache/node-gyp/10.17.0/include/node/v8.h:9901: undefined reference to `v8::Object::SlowGetAlignedPointerFromInternalField(int)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `Statement::JS_expand(v8::FunctionCallbackInfo<v8::Value> const&)':
/usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/objects/statement.lzz:236: undefined reference to `v8::Value::IsBoolean() const'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: /usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/objects/statement.lzz:236: undefined reference to `v8::Boolean::Value() const'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `Statement::JS_expand(v8::FunctionCallbackInfo<v8::Value> const&)':
/usr/src/debug/better-sqlite3/7.1.1-r0/.cache/node-gyp/10.17.0/include/node/v8.h:9901: undefined reference to `v8::Object::SlowGetAlignedPointerFromInternalField(int)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `Statement::JS_raw(v8::FunctionCallbackInfo<v8::Value> const&)':
/usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/objects/statement.lzz:247: undefined reference to `v8::Value::IsBoolean() const'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: /usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/objects/statement.lzz:247: undefined reference to `v8::Boolean::Value() const'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `Statement::JS_raw(v8::FunctionCallbackInfo<v8::Value> const&)':
/usr/src/debug/better-sqlite3/7.1.1-r0/.cache/node-gyp/10.17.0/include/node/v8.h:9901: undefined reference to `v8::Object::SlowGetAlignedPointerFromInternalField(int)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `Database::JS_unsafeMode(v8::FunctionCallbackInfo<v8::Value> const&)':
/usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/objects/database.lzz:350: undefined reference to `v8::Value::IsBoolean() const'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: /usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/objects/database.lzz:350: undefined reference to `v8::Boolean::Value() const'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `Database::JS_unsafeMode(v8::FunctionCallbackInfo<v8::Value> const&)':
/usr/src/debug/better-sqlite3/7.1.1-r0/.cache/node-gyp/10.17.0/include/node/v8.h:9901: undefined reference to `v8::Object::SlowGetAlignedPointerFromInternalField(int)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `NewConstructorTemplate(v8::Isolate*, v8::Local<v8::External>, void (*)(v8::FunctionCallbackInfo<v8::Value> const&), char const*)':
/usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/util/macros.lzz:127: undefined reference to `v8::FunctionTemplate::New(v8::Isolate*, void (*)(v8::FunctionCallbackInfo<v8::Value> const&), v8::Local<v8::Value>, v8::Local<v8::Signature>, int, v8::ConstructorBehavior, v8::SideEffectType)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: /usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/util/macros.lzz:128: undefined reference to `v8::FunctionTemplate::InstanceTemplate()'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: /usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/util/macros.lzz:128: undefined reference to `v8::ObjectTemplate::SetInternalFieldCount(int)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `InternalizedFromLatin1(v8::Isolate*, char const*)':
/usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/util/macros.lzz:27: undefined reference to `v8::String::NewFromOneByte(v8::Isolate*, unsigned char const*, v8::NewStringType, int)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `NewConstructorTemplate(v8::Isolate*, v8::Local<v8::External>, void (*)(v8::FunctionCallbackInfo<v8::Value> const&), char const*)':
/usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/util/macros.lzz:129: undefined reference to `v8::FunctionTemplate::SetClassName(v8::Local<v8::String>)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `NewConstructorTemplate(v8::Isolate*, v8::Local<v8::External>, void (*)(v8::FunctionCallbackInfo<v8::Value> const&), char const*)':
/usr/src/debug/better-sqlite3/7.1.1-r0/.cache/node-gyp/10.17.0/include/node/v8.h:9401: undefined reference to `v8::V8::ToLocalEmpty()'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `SetPrototypeMethod(v8::Isolate*, v8::Local<v8::External>, v8::Local<v8::FunctionTemplate>, char const*, void (*)(v8::FunctionCallbackInfo<v8::Value> const&))':
/usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/util/macros.lzz:139: undefined reference to `v8::HandleScope::HandleScope(v8::Isolate*)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: /usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/util/macros.lzz:140: undefined reference to `v8::FunctionTemplate::PrototypeTemplate()'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `InternalizedFromLatin1(v8::Isolate*, char const*)':
/usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/util/macros.lzz:27: undefined reference to `v8::String::NewFromOneByte(v8::Isolate*, unsigned char const*, v8::NewStringType, int)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `SetPrototypeMethod(v8::Isolate*, v8::Local<v8::External>, v8::Local<v8::FunctionTemplate>, char const*, void (*)(v8::FunctionCallbackInfo<v8::Value> const&))':
/usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/util/macros.lzz:140: undefined reference to `v8::Signature::New(v8::Isolate*, v8::Local<v8::FunctionTemplate>)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: /usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/util/macros.lzz:140: undefined reference to `v8::FunctionTemplate::New(v8::Isolate*, void (*)(v8::FunctionCallbackInfo<v8::Value> const&), v8::Local<v8::Value>, v8::Local<v8::Signature>, int, v8::ConstructorBehavior, v8::SideEffectType)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: /usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/util/macros.lzz:140: undefined reference to `v8::Template::Set(v8::Local<v8::Name>, v8::Local<v8::Data>, v8::PropertyAttribute)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: /usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/util/macros.lzz:139: undefined reference to `v8::HandleScope::~HandleScope()'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `SetPrototypeMethod(v8::Isolate*, v8::Local<v8::External>, v8::Local<v8::FunctionTemplate>, char const*, void (*)(v8::FunctionCallbackInfo<v8::Value> const&))':
/usr/src/debug/better-sqlite3/7.1.1-r0/.cache/node-gyp/10.17.0/include/node/v8.h:9401: undefined reference to `v8::V8::ToLocalEmpty()'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `SetPrototypeSymbolMethod(v8::Isolate*, v8::Local<v8::External>, v8::Local<v8::FunctionTemplate>, v8::Local<v8::Symbol>, void (*)(v8::FunctionCallbackInfo<v8::Value> const&))':
/usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/util/macros.lzz:152: undefined reference to `v8::HandleScope::HandleScope(v8::Isolate*)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: /usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/util/macros.lzz:153: undefined reference to `v8::FunctionTemplate::PrototypeTemplate()'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: /usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/util/macros.lzz:153: undefined reference to `v8::Signature::New(v8::Isolate*, v8::Local<v8::FunctionTemplate>)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: /usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/util/macros.lzz:153: undefined reference to `v8::FunctionTemplate::New(v8::Isolate*, void (*)(v8::FunctionCallbackInfo<v8::Value> const&), v8::Local<v8::Value>, v8::Local<v8::Signature>, int, v8::ConstructorBehavior, v8::SideEffectType)'

...

/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: /usr/src/debug/better-sqlite3/7.1.1-r0/.cache/node-gyp/10.17.0/include/node/v8.h:9469: undefined reference to `v8::V8::DisposeGlobal(v8::internal::Object**)'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/better_sqlite3/src/better_sqlite3.o: in function `_register_better_sqlite3':
/usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/./src/better_sqlite3.lzz:67: undefined reference to `node_module_register'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/deps/sqlite3.a(sqlite3.o): in function `unixDlError':
/usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/Release/obj/gen/sqlite3/sqlite3.c:39994: undefined reference to `dlerror'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/deps/sqlite3.a(sqlite3.o): in function `unixDlClose':
/usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/Release/obj/gen/sqlite3/sqlite3.c:40025: undefined reference to `dlclose'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/deps/sqlite3.a(sqlite3.o): in function `unixDlSym':
/usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/Release/obj/gen/sqlite3/sqlite3.c:40021: undefined reference to `dlsym'
/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/ld: Release/obj.target/deps/sqlite3.a(sqlite3.o): in function `unixDlOpen':
/usr/src/debug/better-sqlite3/7.1.1-r0/npmpkg/build/Release/obj/gen/sqlite3/sqlite3.c:39980: undefined reference to `dlopen'
collect2: error: ld returned 1 exit status
make: *** [better_sqlite3.target.mk:139: Release/obj.target/better_sqlite3.node] Error 1
rm b857c92884e9598d609f6be182a2595df7a8e00f.intermediate
make: Leaving directory '/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/npmpkg/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:193:23)
gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Linux 5.8.0-50-generic
gyp ERR! command "/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/bin/node" "/home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/recipe-sysroot-native/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release"
gyp ERR! cwd /home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/npmpkg
gyp ERR! node -v v10.17.0
gyp ERR! node-gyp -v v5.0.3
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! better-sqlite3@7.1.1 build-release: `node-gyp rebuild --release`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the better-sqlite3@7.1.1 build-release script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/npm_cache/_logs/2021-04-30T07_29_55_452Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! better-sqlite3@7.1.1 install: `prebuild-install || npm run build-release`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the better-sqlite3@7.1.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/npm_cache/_logs/2021-04-30T07_29_55_474Z-debug.log
WARNING: exit code 1 from a shell command.
ERROR: Function failed: do_compile (log file is located at /home/Documents/poky/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/temp/log.do_compile.9585)

The second issue you reference is the same as the first. Maybe a copy/past error?

I'm seriously thinking about downgrading to an older version of better-sqlite3...

Edit: I tried to run the code on my own x64 machine with the same node version using the n command:

$ n 10.17.0
  installing : node-v10.17.0
   mkdir : /usr/local/n/versions/node/10.17.0
   fetch : https://nodejs.org/dist/v10.17.0/node-v10.17.0-linux-x64.tar.xz

It compiles and run perfectly...

The second issue you reference is the same as the first. Maybe a copy/past error?

Oops. Yup. Unfortunately I can't find what I meant to link there anymore.

It compiles and run perfectly...

This confirms our original suspicion being the platform. It can also be an issue with the compilation for that specific architecture. Is there any way you can try the same thing on the same hardware (your RPi) but a different kernel/build of an OS?

I read in the README of better-sqlite3:

You must be using Node.js v10.20.1 or above. Prebuilt binaries are available for LTS versions.

So I'm compiling Node v10.24.1 for my RPi and it takes a while...

I also had a look on the Electron release timeline to see what's the Node version of v7.2.3. The answer is: v12.8. Unfortunately, I don't have a v12 recipe to compile with OpenEmbedded. Embedded systems world moves slower than the Web apps world.

I'm having issues with my app Beekeeper Studio, when installed on Debian-buster based OSs.

I get the dreded DriverPackageNotInstalledError Try to install it - npm install better-sqlite3

I don't see this issue on Manjaro, Ubuntu, or any other OS I've tested, only those based on Debian.

Does anyone with more Linux knowledge than me have any ideas here?

@rathboma Which version of better-sqlite3 are you using?

Debian may not ship with the sqlite package installed by default, eg. apt-get install build-essential -y? Alternatively, you may not be shipping with better-sqlite3 available unpacked from your ASAR?

@alectrocute I don't think it matters if the OS has Sqlite installed as the native libraries are bundled with better-sqlite3. It works across all other platforms (including Windows), it's a unique issue with Debian. Installing sqlite3 on Buster also doesn't help.

@rathboma taking a long shot here. Does the error occur on both main and renderer?

@alectrocute @m4heshd I've found the issue.

It's similar to #403

The error shown was from TypeOrm and hid the real error, I dug around and found that it's a glibc error:

Error: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /home/rathboma/Downloads/beekeeper-studio/node_modules/better-sqlite3/build/Release/better_sqlite3.node)
    at process.func [as dlopen] (electron/js2c/asar_bundle.js:5:1846)
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1138:18)
    at Object.func [as .node] (electron/js2c/asar_bundle.js:5:1846)
    at Module.load (internal/modules/cjs/loader.js:935:32)
    at Module._load (internal/modules/cjs/loader.js:776:14)
    at Function.f._load (electron/js2c/asar_bundle.js:5:12684)
    at Module.require (internal/modules/cjs/loader.js:959:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at bindings (/home/rathboma/Downloads/beekeeper-studio/node_modules/bindings/bindings.js:112:48)
    at Object.<anonymous> (/home/rathboma/Downloads/beekeeper-studio/node_modules/better-sqlite3/lib/database.js:9:24)

This only happens at runtime on Buster.

@rathboma Nice find!

@alectrocute @m4heshd I've found the issue.

And this was spit out only through the main process debugger right? Unless you're using Electron with nodeIntegration set to true.

@m4heshd I use sqlite in both the main and renderer processes. Because of this it was spit out by main -- it never got to the renderer, but it would spit it out in the renderer too.

I see. Glad you managed to track it down because this could be a reference for the future. I feel like it belongs on a new issue mostly because It's definitely not limited to Electron.

Yep, there are two existing issues tracking it. I've also created a pr. #631

I am using electron react boilerplate and better-sqlite3. My app starts and runs without any issues but when I try to run tests using Jest I get the following error:

TypeError: exists is not a function

    > 1 | import BetterSqlite3 from 'better-sqlite3';
        | ^
      2 | import Configuration from '../constants/Configuration';
      3 | import SqlQuery from '../types/SqlQuery';
      4 |

      at Function.getRoot (app/node_modules/bindings/bindings.js:203:7)
      at bindings (app/node_modules/bindings/bindings.js:82:32)
      at Object.<anonymous> (app/node_modules/better-sqlite3/lib/database.js:9:24)
      at Object.<anonymous> (app/node_modules/better-sqlite3/lib/index.js:2:18)
      at Object.<anonymous> (app/src/repositories/BaseRepo.ts:1:1)

I have tried:

  • Rebuilding better-sqlite3 using electron-rebuild
  • Converting my repo class (the one that is importing better-sqlite3) from TypeScript to JavaScript
  • Tried running Jest as 'node' environment

Any ideas?

@alex-buys-github Which node version are you using? node -v

@alex-buys-github It's trying to access the fs module which is unable to access when you're running the tests. I'm not familiar with Jest but I think you have to mock it. Although I'm not sure why it didn't work when you ran it as node. No idea about that.

Another thing you should know is that your better-sqlite3 installation is built for Electron's node ABI which differs from your local node ABI. So it would fail no matter what. You need to run Jest with the Electron executable instead of running it directly. To be cross-platform compatible, I'd use cross-env and do something like this.

"scripts": {
  "test": "cross-env ELECTRON_RUN_AS_NODE=1 electron ./node_modules/jest-cli/bin/jest.js"
}

If you are on the latest version of better-sqlite3 and getting an error like:

was compiled against a different Node.js version using NODE_MODULE_VERSION 89. This version of Node.js requires NODE_MODULE_VERSION 98.

This is being tracked #694 and will perhaps be addressed in #702, but the issue has work-arounds included.

I ended up manually rebuilding against my target electron version with:

#!/bin/bash

# https://github.com/electron/electron-rebuild/issues/591

# Electron's version.
# example of electron -v --> v15.1.1
export npm_config_target=$(npx electron -v)

# The architecture of Electron, see https://electronjs.org/docs/tutorial/support#supported-platforms
# for supported architectures.
export npm_config_arch=x64
export npm_config_target_arch=x64

# Download headers for Electron.
export npm_config_disturl=https://electronjs.org/headers

# Tell node-pre-gyp that we are building for Electron.
export npm_config_runtime=electron

# Tell node-pre-gyp to build module from source code.
export npm_config_build_from_source=true

HOME=~/.electron-gyp npm rebuild better-sqlite3

To anybody interested, I'm maintaining an encryption enabled fork of better-sqlite3 named better-sqlite3-multiple-ciphers. Stability has been tested for months. Everything works exactly similar to better-sqlite3 but with added encryption features. Works really well with Electron too. 😊

@m4heshd Can you share a working demo with Electron. I have been trying it on Electron-React-boilerplate for some time now, it didn't go well. Please share if you have a demo or just answer the question here.

it didn't go well

It would be great if you can share a reproducible repo.

Can you share a working demo with Electron.

The API doesn't change for Electron specifically. It's exactly the same when used in both Main and Renderer processes. Basic encryption usage is right there in the documentation.

Looking at that comment, you're using the original version of better-sqlite3. It might has to do something with TS. It it is, I'm not the one to answer this. But a repro would help anybody who's willing to debug it for you.

Consider this example created by using the following steps:

git clone --depth=1 https://github.com/electron-react-boilerplate/electron-react-boilerplate.git better-sqlite3-test
cd better-sqlite3-test
yarn
cd ./release/app
yarn add better-sqlite3
cd ../..
yarn add -D @types/better-sqlite3

Now, as soon as I start using the DB like this

I am getting the error:

Uncaught TypeError: Database is not a constructor
    at B3SqliteDB.startDB (renderer.dev.js:65346)
    at renderer.dev.js:65285

Can someone please help to figure this out! TYA

@TechGrizzlee Taking a guess here since I don't have access to my PC right now to debug your repo. This was my first guess when you originally posted the question too.

Try enabling nodeIntegration for the renderer. Might also have to disable contextIsolation. You mostly likely won't need to. Remember this is not secure at all. Use this just for debugging. Once you figure it out, it's up to you to establish the levels of security your app might require. I'm going all out on the following snippet (extremely non-secure).

On your src/main/main.ts:

mainWindow = new BrowserWindow({
    show: false,
    width: 1024,
    height: 728,
    icon: getAssetPath('icon.png'),
    webPreferences: {
      nodeIntegration: true,
      contextIsolation: false,
      preload: path.join(__dirname, 'preload.js'),
    }

I've set this up and it appears to be working with very little effort!

import DB from "better-sqlite3";
const db = new DB("mydb.sqlite");

However I'm curious, where did that mydb.sqlite file get created? I searched for it on my local file system but got no hits. I poked around the %appdata% folder but didn't find it there. Using Windows.

where did that mydb.sqlite file get created?

In CWD which most likely is your project's root directory. Node's relative paths always defaults to CWD as root.

Thanks. It looks like Windows automatically removed my repo directory from Indexing Options. Maybe it does that when it detects too much file activity?

Consider this example created by using the following steps:

git clone --depth=1 https://github.com/electron-react-boilerplate/electron-react-boilerplate.git better-sqlite3-test
cd better-sqlite3-test
yarn
cd ./release/app
yarn add better-sqlite3
cd ../..
yarn add -D @types/better-sqlite3

Now, as soon as I start using the DB like this

I am getting the error:

Uncaught TypeError: Database is not a constructor
    at B3SqliteDB.startDB (renderer.dev.js:65346)
    at renderer.dev.js:65285

Can someone please help to figure this out! TYA

Same issue as @TechGrizzlee, already tried your instructions @m4heshd but no differences. Got Database is not a constructor too.

It is also noted that better-sqlite3 should be in "dependencies" and try all other steps again if need (rm node_modules, lock files, electron-rebuild, etc.)

#126 (comment) didn't really help me, just another error now
epic

setting

    new CopyPlugin({
      patterns: [
        { from: Path.join(appSrc, `node_modules`, `better-sqlite3`), to: Path.join(appDest, `node_modules`, `better-sqlite3`) },
        { from: Path.join(appSrc, `node_modules`, `bindings`), to: Path.join(appDest, `node_modules`, `better-sqlite3`, `node_modules`, `bindings`) },
        { from: Path.join(appSrc, `node_modules`, `file-uri-to-path`), to: Path.join(appDest, `node_modules`, `better-sqlite3`, `node_modules`, `file-uri-to-path`) },
        { from: Path.join(appSrc, `node_modules`, `better-sqlite3`, `build`, `Release`, `better_sqlite3.node`), to: Path.join(appDest, `better_sqlite3.node`) }
      ]
    }),

and

  externals: {
    'better-sqlite3': `commonjs better-sqlite3`
  }
COMPILING=true electron-builder --win --ia32 --dir

  • electron-builder  version=22.14.13 os=10.0.19043
  • loaded configuration  file=package.json ("build" field)
  • author is missed in the package.json  appPackageFile=build\package.json
  • writing effective config  file=release\builder-effective-config.yaml
  • rebuilding native dependencies  dependencies=better-sqlite3@7.5.1 platform=win32 arch=ia32
  • install prebuilt binary  name=better-sqlite3 version=7.5.1 platform=win32 arch=ia32 napi=
  • packaging       platform=win32 arch=ia32 electron=11.5.0 appOutDir=release\win-ia32-unpacked

I get this error
error
Also tried having the .node file in /resources/, outside of app.asar but same win32 application error. I'm using electron-builder and building x32 on a x64 system if that matters, electron version 11.5.0.

I get this error: SqliteError: file is not a database

Following the indications found here: https://stackoverflow.com/questions/48974135/sqlite-error-file-is-not-a-database I double-checked that the path does not contain .db extension:

export const getInfopiecesDbpath = () {
  const isEnvDevelopment = process.env.NODE_ENV === 'development'

  const infopiecesDbpath = isEnvDevelopment
    ? path.join(app.getAppPath(), "src", "data", "infopieces")
    : path.join(app.getAppPath(), ".webpack", "data", "infopieces")
  return infopiecesDbpath
}

const createInfopiecesTable: any = `
  CREATE TABLE IF NOT EXISTS infopieces (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    infotext TEXT NOT NULL
  );`

const createInfopiecesIndex = `PRAGMA INDEX_LIST(infopieces);`
 
export function initializeInfopiecesDB(db: Database) {
  db.prepare(createInfopiecesTable).run()
  db.prepare(createInfopiecesIndex).get()
}

const insertIP = `
    INSERT INTO infopiecesDb (id, infotext)
    VALUES (ip.id, ip.infotext)
  `

export const insertInfopiece = (ip: IInfopiece) => {
  infopiecesDb.prepare(insertIP).run(ip)
}

let infopiecesDbpath = getInfopiecesDbpath()
let infopiecesDb = require('better-sqlite3-multiple-ciphers')(infopiecesDbpath, { verbose: console.log })
infopiecesDb.pragma("key='secret-key'")

initializeInfopiecesDB(infopiecesDb)

in main :

let infopiecesDbpath = getInfopiecesDbpath()
let infopiecesDb = require('better-sqlite3-multiple-ciphers')(infopiecesDbpath, { verbose: console.log })
infopiecesDb.pragma("key='secret-key'")
initializeInfopiecesDB(infopiecesDb)


ipcMain.handle ("insert-infopiece-intodb", (IpcMainEvent, message) => {
  console.log("ipcMain.hanlde-insert-infopiece-intodb-message: ", message.ip_01)
  insertInfopiece(message.ip_01)
})

I get this error:

Error occurred in handler for 'insert-infopiece-intodb': SqliteError: file is not a database
    at Database.prepare (/home/raphy/Playground/.webpack/main/index.js:652:21)
    at insertInfopiece (/home/raphy/Playground/.webpack/main/index.js:1773:18)
    at /home/raphy/Playground/.webpack/main/index.js:1943:32
    at node:electron/js2c/browser_init:193:579
    at EventEmitter.<anonymous> (node:electron/js2c/browser_init:161:10433)
    at EventEmitter.emit (node:events:390:28) {
  code: 'SQLITE_NOTADB'
}

Other info:

"@types/better-sqlite3": "^7.5.0",
"better-sqlite3": "^7.5.3",
"better-sqlite3-multiple-ciphers": "^7.5.2",
"electron": "17"
 node:  v16.15.0

What am I missing and / or doing wrongly?

I have also run into the TypeError: better_sqlite3_1.default is not a constructor error as of late. I am using electron-react-boilerplate to take care of all the boilerplate/scaffolding.

Ideally, I would like to use BetterSqlite3 in the renderer (i.e. React). However, when doing so, I get the error mentioned above.
I've tried everything in this thread and can't get it to work at all.

That being said, I can get BetterSqlite3 to work in main.ts (Electron side). And then send the data to React using IPC. I am not sure if this is preferable, secure or aligns with best practice. If so, I am happy to go that route.

Has anyone managed to successfully create a db instance (new BetterSqlite3(databasePath)) in the renderer?

ilDon commented

I'm trying to use better-sqlite3 with Electron v. 20.0.0.
Unfortunately the build process of node-gyp fails when I try to build the bindings for better-sqlite3.
On macOS 12.5, the output is the following:

Node.js v17.8.0
    gyp info it worked if it ends with ok
    gyp info using node-gyp@9.1.0
    gyp info using node@17.8.0 | darwin | arm64
    gyp info find Python using Python version 3.10.4 found at "/Library/Frameworks/Python.framework/Versions/3.10/bin/python3"
    gyp info spawn /Library/Frameworks/Python.framework/Versions/3.10/bin/python3
    gyp info spawn args [
    gyp info spawn args   '/Users/user/Source/electron-app/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/Source/electron-app/node_modules/better-sqlite3/build/config.gypi',
    gyp info spawn args   '-I',
    gyp info spawn args   '/Users/user/Source/electron-app/node_modules/node-gyp/addon.gypi',
    gyp info spawn args   '-I',
    gyp info spawn args   '/Users/user/.electron-gyp/20.0.0/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/user/.electron-gyp/20.0.0',
    gyp info spawn args   '-Dnode_gyp_dir=/Users/user/Source/electron-app/node_modules/node-gyp',
    gyp info spawn args   '-Dnode_lib_file=/Users/user/.electron-gyp/20.0.0/<(target_arch)/node.lib',
    gyp info spawn args   '-Dmodule_root_dir=/Users/user/Source/electron-app/node_modules/better-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 args ]
    gyp info spawn make
    gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
    In file included from ../src/better_sqlite3.cpp:4:
    In file included from ./src/better_sqlite3.lzz:11:
    In file included from /Users/user/.electron-gyp/20.0.0/include/node/node.h:69:
    In file included from /Users/user/.electron-gyp/20.0.0/include/node/v8.h:24:
    In file included from /Users/user/.electron-gyp/20.0.0/include/node/v8-array-buffer.h:13:
    In file included from /Users/user/.electron-gyp/20.0.0/include/node/v8-object.h:9:
    /Users/user/.electron-gyp/20.0.0/include/node/v8-maybe.h:106:45: error: no template named 'is_lvalue_reference_v' in namespace 'std'; did you mean 'is_lvalue_reference'?
      template <class U, std::enable_if_t<!std::is_lvalue_reference_v<U>>*>
                                          ~~~~~^~~~~~~~~~~~~~~~~~~~~
                                                is_lvalue_reference
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:910:29: note: 'is_lvalue_reference' declared here
    struct _LIBCPP_TEMPLATE_VIS is_lvalue_reference : _BoolConstant<__is_lvalue_reference(_Tp)> { };
                                ^
    In file included from ../src/better_sqlite3.cpp:4:
    In file included from ./src/better_sqlite3.lzz:11:
    In file included from /Users/user/.electron-gyp/20.0.0/include/node/node.h:69:
    In file included from /Users/user/.electron-gyp/20.0.0/include/node/v8.h:24:
    In file included from /Users/user/.electron-gyp/20.0.0/include/node/v8-array-buffer.h:13:
    In file included from /Users/user/.electron-gyp/20.0.0/include/node/v8-object.h:9:
    /Users/user/.electron-gyp/20.0.0/include/node/v8-maybe.h:106:69: error: expected '(' for function-style cast or type construction
      template <class U, std::enable_if_t<!std::is_lvalue_reference_v<U>>*>
                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
    /Users/user/.electron-gyp/20.0.0/include/node/v8-maybe.h:123:43: error: no template named 'is_lvalue_reference_v' in namespace 'std'; did you mean 'is_lvalue_reference'?
    template <class T, std::enable_if_t<!std::is_lvalue_reference_v<T>>* = nullptr>
                                        ~~~~~^~~~~~~~~~~~~~~~~~~~~
                                              is_lvalue_reference
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:910:29: note: 'is_lvalue_reference' declared here
    struct _LIBCPP_TEMPLATE_VIS is_lvalue_reference : _BoolConstant<__is_lvalue_reference(_Tp)> { };
                                ^
    In file included from ../src/better_sqlite3.cpp:4:
    In file included from ./src/better_sqlite3.lzz:11:
    In file included from /Users/user/.electron-gyp/20.0.0/include/node/node.h:69:
    In file included from /Users/user/.electron-gyp/20.0.0/include/node/v8.h:24:
    In file included from /Users/user/.electron-gyp/20.0.0/include/node/v8-array-buffer.h:13:
    In file included from /Users/user/.electron-gyp/20.0.0/include/node/v8-object.h:9:
    /Users/user/.electron-gyp/20.0.0/include/node/v8-maybe.h:123:67: error: expected '(' for function-style cast or type construction
    template <class T, std::enable_if_t<!std::is_lvalue_reference_v<T>>* = nullptr>
                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
    ./src/util/macros.lzz:157:21: error: no member named 'AccessorSignature' in namespace 'v8'
                    v8::AccessorSignature::New(isolate, recv)
                    ~~~~^
    ./src/objects/database.lzz:180:21: warning: variable 'status' set but not used [-Wunused-but-set-variable]
                    int status = sqlite3_db_config(db_handle, SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION, 1, NULL);
                        ^
    ./src/util/binder.lzz:37:51: error: no member named 'CreationContext' in 'v8::Object'
                    v8::Local<v8::Context> ctx = obj->CreationContext();
                                                ~~~~~^

@ilDon,
I got the same problem on a winows system. Electron <= 19.. (V8 10.2) works well without errors.
Looks like some breaking changes in the V8 Header source files of V8 10.4.

I got errors upgrading to Electron 20 as well, created #867 for it.

Edit: There was #858 already 😳

Hi,

I try to use better-sqlite3 in a Vue3, Vite, Electron with TS app. It works well when running it in dev mode, but when I want to build and release the app I get the next error when I want to run the app after I install it.

image

I use pnpm, Node 18.12.0, Eelectron 21.1.0 and better-sqlite3 8.0.1.

The content of package.json

{
	"name": "appointments",
	"private": true,
	"version": "0.0.1",
	"main": "dist/electron/main.js",
	"scripts": {
		"vite:dev": "vite",
		"vite:build": "vue-tsc --noEmit && vite build",
		"preview": "vite preview",
		"watch": "tsc -w",
		"desktop:dev": "tsc && concurrently vite \" electron .\" \"tsc -w\"",
		"desktop:build": "npm run vite:build && tsc && electron-builder",
		"desktop:preview": "npm run vite:build && tsc && electron .",
		"rebuild:sqlite3": "electron-rebuild -f -w better-sqlite3"
	},
	"dependencies": {
		"better-sqlite3": "~8.0.1",
		"pinia": "~2.0.24",
		"vue": "~3.2.37"
	},
	"devDependencies": {
		"@electron/rebuild": "~3.2.10",
		"@types/better-sqlite3": "~7.6.2",
		"@vitejs/plugin-vue": "~3.1.0",
		"autoprefixer": "~10.4.12",
		"concurrently": "~7.4.0",
		"electron": "~21.1.0",
		"electron-builder": "~23.6.0",
		"postcss": "~8.4.17",
		"tailwindcss": "~3.1.8",
		"typescript": "~4.6.4",
		"vite": "~3.1.0",
		"vue-tsc": "~0.40.4"
	}
}

The content of electron-builder.json

{
	"appId": "appointments",
	"asar": true,
	"directories": {
		"buildResources": "assets",
		"output": "release"
	},
	"includeSubNodeModules": true,
	"buildDependenciesFromSource": true,
	"nodeGypRebuild": false,
	"files": ["dist"],
	"win": {
		"target": [
			{
				"target": "nsis",
				"arch": ["x64"]
			}
		],
		"artifactName": "${productName}_${version}.${ext}"
	},
	"nsis": {
		"oneClick": true,
		"perMachine": true,
		"allowToChangeInstallationDirectory": false,
		"deleteAppDataOnUninstall": true
	}
}

Any advice ?

@dragos-boisteanu Add the following to your electron-builder.json

"asarUnpack": [
    "**/node_modules/better-sqlite3/**/*",
    "**/node_modules/bindings/**/*",
    "**/node_modules/file-uri-to-path/**/*",
]

It doesn't work. Even whith this code added I have the same error when running the app.

{
	"appId": "appointments",
	"asar": true,
	"directories": {
		"buildResources": "assets",
		"output": "release"
	},
	"includeSubNodeModules": true,
	"buildDependenciesFromSource": true,
	"nodeGypRebuild": false,
	"files": ["dist"],
	"win": {
		"target": [
			{
				"target": "nsis",
				"arch": ["x64"]
			}
		],
		"artifactName": "${productName}_${version}.${ext}"
	},
	"nsis": {
		"oneClick": true,
		"perMachine": true,
		"allowToChangeInstallationDirectory": false,
		"deleteAppDataOnUninstall": true
	},
	"asarUnpack": [
    "**/node_modules/better-sqlite3/**/*",
    "**/node_modules/bindings/**/*",
    "**/node_modules/file-uri-to-path/**/*"
	]
}

image

It doesn't work. Even whith this code added I have the same error when running the app.

You sure it's properly unpacked? Check if the app.asar.unpacked directory exists. It should be right next to the app.asar file. bs3 still seem to be executing from inside the asar package. I can't remember exactly but you might also need to unpack the source file that requires bs3 too. Also you should create a reproducible repo to get better assistance.

It's a basic project with Vue3, Pinia, Router, Tailwind, Electron and TS. I am just starting.

The app.asar.unpacked exists
image

And this is what's inside it
image

It's a basic project with Vue3, Pinia, Router, Tailwind, Electron and TS. I am just starting.

Then simply push that source to a public repo and share it here. I've run into this issue a million times and it's always different with each project. It's a waste of everyone's time trying to debug issues on a different source. Your issue could simply be because of the main process being transpiled since you're using TS. Who knows? 🤷🏽 It's always great when people who're willing to help you can start with a simple git clone .....

Well this is odd. The source you shared, it works perfectly fine for me in both dev and after being built. No errors at all. No changes either. I'm on the latest version of Windows 11. That hardly matters.

I see that if I use npm install instead of pnpm and ran the app as administrator(otherwise it can't create the database) it works. Isn't better-sqlite3 compatible with pnpm ?

Isn't better-sqlite3 compatible with pnpm ?

Oh that I'm not very sure about. Considering the amount of third-party stuff coming together in these projects, I would personally stick to conventional tools as much as possible. That's why I don't even use yarn. That's just my personal opinion.

ran the app as administrator(otherwise it can't create the database)

That's not normal. This will happen if you have your app installed in a directory like ProgramFiles and you don't utilize the user data directory. Double check the way you distribute your application. Regular day-to-day apps should never require elevated permissions to function.

import path from "path";

const userData = app.getPath('userData');
const dbPath =  path.join(userData, 'appointments.db')
const db = new Database(dbPath);

Made something like this in main.ts and now it works without elevated permissions.

Thank you for your help. Now it works well. Maybe these info can help others who face the same problems.

I'm trying to update the dependencies in a project and am testing parts of our workflow as I update things. Right now, I'm having a problem getting better-sqlite3 to rebuild using electron-rebuild (which we use all the time to flip back and forth between running things in node or electron). I've tried better-sqlite3@8.0.1 in two different environments and get the same result when trying to rebuild for electron. I'm using an M1 Mac; not sure if that contributes to the problem. These are the errors I get at the end of the rebuild:

make: *** [Release/obj.target/better_sqlite3/src/better_sqlite3.o] Error 1
rm ba23eeee118cd63e16015df367567cb043fed872.intermediate
✖ Rebuild Failed

An unhandled error occurred inside electron-rebuild
node-gyp failed to rebuild '[redacted]/sqlite3-migrator/node_modules/better-sqlite3'.
For more information, rerun with the DEBUG environment variable set to "electron-rebuild".

Error: `make` failed with exit code: 2



Error: node-gyp failed to rebuild '[redacted]/sqlite3-migrator/node_modules/better-sqlite3'.
For more information, rerun with the DEBUG environment variable set to "electron-rebuild".

Error: `make` failed with exit code: 2


    at NodeGyp.rebuildModule ([redacted]/node_modules/@electron/rebuild/lib/src/module-type/node-gyp.js:120:19)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async ModuleRebuilder.rebuildNodeGypModule ([redacted]/node_modules/@electron/rebuild/lib/src/module-rebuilder.js:98:9)
    at async ModuleRebuilder.rebuild ([redacted]/node_modules/@electron/rebuild/lib/src/module-rebuilder.js:128:14)
    at async Rebuilder.rebuildModuleAt ([redacted]/node_modules/@electron/rebuild/lib/src/rebuild.js:149:13)
    at async Rebuilder.rebuild ([redacted]/node_modules/@electron/rebuild/lib/src/rebuild.js:112:17)
    at async [redacted]/node_modules/@electron/rebuild/lib/src/cli.js:158:9

I've tried it in both of these environments:

  1. electron 22.0.0, node 18.12.1
  2. electron 21.3.3, node 16.16.0

Any ideas or suggestions? Thanks!

@bjornhanson That could be a lot of issues. Try the solutions from this SO thread. Also you should get a better debug output using the printed instructions.

For more information, rerun with the DEBUG environment variable set to "electron-rebuild".

I'm seeing these two errors in the output:

./src/util/macros.lzz:157:21: error: no member named 'AccessorSignature' in namespace 'v8'
                v8::AccessorSignature::New(isolate, recv)
./src/util/binder.lzz:37:51: error: no member named 'CreationContext' in 'v8::Object'
                v8::Local<v8::Context> ctx = obj->CreationContext();

I see those mentioned above and there's #858, which was closed, but I'm getting these errors with better-sqlite3@8.0.1. Any ideas?

Edit: I should note I'm using an M1 Mac. I've seen some stuff about C++ 17, but it appears that #870 made a change for that.

It looks like I'll have to use electron@19.1.9 for now. Using newer versions is where electron-rebuild fails to rebuild better-sqlite3. I also have trouble with better-sqlite3@8.0.1 where my app won't load, but v8.0.0 works.

I was completely frustrated and just about to give up. So I started checking other sqlite libraries. And found this information: https://github.com/TryGhost/node-sqlite3#custom-builds-and-electron.

So I switched from yarn to npm. Then installed the latest better-sqlite3 (8.0.1) and electron (22.0.1). Then ran this command:

npm install better-sqlite3 --build-from-source --runtime=electron --target=22.0.1 --dist-url=https://electronjs.org/headers --force

And it works 🎆

Meanwhile it seems I have run into the next hurdle: The project now needs to use custom built encrypted databases.

So I am now compiling sqlite using see. Happily I found this advice on how to use such a custom build with better-sqlite3.

And while developing all seemed well and cozy 😀

Then I ran npm run build, hoping to deliver this shiny new piece of software I am a bit proud of. Everything worked and I clicked the .exe to watch it open in all it's glory:

Uncaught Exception: Cannot find module 'better-sqlite3'

Life is hard 😢

I do not really know what is causing this. I think it has to do with the fact that better-sqlite3 is not listed as dependency in package.json. Though due to the preinstall script it is included in the node_modules folder (and thus works in dev mode).

If I add better-sqlite3 to the dependencies in package.json it works. BUT: not the specially compiled, encrypted version is used by the build. Instead, the version listed as dependency. Which can not deal with encrypted db files.

What I have tried is adding

"asarUnpack": [
    "**/node_modules/better-sqlite3/**/*"
  ],

to electron-builder.json. And after building manually copying the better-sqlite3-Folder from node_modules into win-unpacked/resources/app.asar.unpacked/node_modules.

But that does not seem to work.

Any advice? 🙏

Here is my project: https://github.com/barbalex/awel-personal-vite.


Edit: I solved it with two measures:

In electron-builder.json:

"npmRebuild": false

Goal: prevent electron-builder from rebuilding the native module itself.

After running the prebuild-script, add this line to dependencies inside package.json:

"better-sqlite3": "file:./node_modules/better-sqlite3",

Goal: Give electron-builder a module since it seems to want one.

Life is great again 😄

This is how I solved the trouble, struggled for a long long time... There is a point that other issues don't mention, that is if the better-sqlite is installed with --save-dev, execute electron-rebuild command should add -t dev parameter, otherwise better-sqlite3 won't be rebuilt.

  • Problem log
node_modules/better-sqlite3/build/Release/better_sqlite3.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 108. This version of Node.js requires
NODE_MODULE_VERSION 113.
  • (Worth noting but doesn't seem necessary: Use the same Node.js version of Electron was built on.)
npm install --save-dev electron-rebuild
npm install --save-dev better-sqlite3

npx electron-rebuild -f -w -t dev better-sqlite3
QThans commented

Meanwhile it seems I have run into the next hurdle: The project now needs to use custom built encrypted databases.

So I am now compiling sqlite using see. Happily I found this advice on how to use such a custom build with better-sqlite3.

And while developing all seemed well and cozy 😀

Then I ran npm run build, hoping to deliver this shiny new piece of software I am a bit proud of. Everything worked and I clicked the .exe to watch it open in all it's glory:

Uncaught Exception: Cannot find module 'better-sqlite3'

Life is hard 😢

I do not really know what is causing this. I think it has to do with the fact that better-sqlite3 is not listed as dependency in package.json. Though due to the preinstall script it is included in the node_modules folder (and thus works in dev mode).

If I add better-sqlite3 to the dependencies in package.json it works. BUT: not the specially compiled, encrypted version is used by the build. Instead, the version listed as dependency. Which can not deal with encrypted db files.

What I have tried is adding

"asarUnpack": [
    "**/node_modules/better-sqlite3/**/*"
  ],

to electron-builder.json. And after building manually copying the better-sqlite3-Folder from node_modules into win-unpacked/resources/app.asar.unpacked/node_modules.

But that does not seem to work.

Any advice? 🙏

Here is my project: https://github.com/barbalex/awel-personal-vite.

Edit: I solved it with two measures:

In electron-builder.json:

"npmRebuild": false

Goal: prevent electron-builder from rebuilding the native module itself.

After running the prebuild-script, add this line to dependencies inside package.json:

"better-sqlite3": "file:./node_modules/better-sqlite3",

Goal: Give electron-builder a module since it seems to want one.

Life is great again 😄

I solved my problem with this advice, let my life be great again😄😄
However,

"better-sqlite3": "file:./node_modules/better-sqlite3",

for me, I used

"better-sqlite3": "file:./node_modules/better-sqlite3/bin",

我的问题情况如下:

  1. 使用electron19+better-sqlite3,然后在执行electron .的时候,报错nodegyp错误,后来找到解决办法,先安装electron-rebuild,然后执行以下命令,并加入到package.json文件的scripts中
    electron-rebuild -f -w better-sqlite3
    执行之后可以顺利执行electron .
  2. 然而在electron-builder时,却出现问题,后来又发现了electron-rebuild还有另外一个命令,
    electron-rebuild -f -w -t dev better-sqlite3
    执行之后可以顺利 electron-builder

I'm still unable to upgrade to anything beyond Electron 19 because electron-rebuild is failing to rebuild better-sqlite3. I'm seeing the same errors @ilDon mentioned a year ago (#126 (comment)). I recently looked at this again and tried all of the current stable versions of Electron while running the same version of Node they use. Currently trying electron@25.5.0 with Node v18.15.0, @electron/rebuild@3.2.13, and better-sqlite3@8.5.0. Here are some error examples:

In file included from ../src/better_sqlite3.cpp:4:
In file included from ./src/better_sqlite3.lzz:11:
In file included from /Users/bjorn/.electron-gyp/25.5.0/include/node/node.h:79:
In file included from /Users/bjorn/.electron-gyp/25.5.0/include/node/v8.h:24:
In file included from /Users/bjorn/.electron-gyp/25.5.0/include/node/v8-array-buffer.h:13:
In file included from /Users/bjorn/.electron-gyp/25.5.0/include/node/v8-object.h:9:
/Users/bjorn/.electron-gyp/25.5.0/include/node/v8-maybe.h:106:69: error: expected '(' for function-style cast or type construction
        template <class U, std::enable_if_t<!std::is_lvalue_reference_v<U>>*>
                                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

./src/util/macros.lzz:157:21: error: no member named 'AccessorSignature' in namespace 'v8'
                v8::AccessorSignature::New(isolate, rcv)
                ~~~~^

../src/util/binder.lzz:37:51: error: no member named 'CreationContext' in 'v8::Object'
                 v8::Local<v8::Context> ctx = obj->CreationContext();
                                              ~~~~~^

I've seen some related things around GitHub, but haven't found anything that works. One person thinks it's a bug in Node that needs to get resolved. I'm not sure where to go from here, other than to sit on Electron 19, which isn't supported anymore. Any ideas? Thanks in advance!

Know that there are a ton of caches that may need to be blown away before you get an actual "clean" build. I've got this in my clean:gyp task:

rm -rf ~/.electron/ ~/.cache/electron* ~/.electron-gyp/ ~/.node-gyp/ ~/.cache/yarn/

So, on a vanilla electron install without modification, I ran into this issue.

I installed better-sqlite3 using npm install -D better-sqlite3 and it installed.

Ran electron, got the error as described.

Added this to package.json as a script:

"rebuildsqlite": "npx electron-rebuild -f -w -t dev better-sqlite3"

Remember to add commas as appropriate to delimit the script lines.

Error disappeared. Added a quick reference to a sqlite database and tested a quick write-read entry. Fully working!

i get this error even with not using electron anywhere

Hi. I'm having issues getting better-sqlite3 to work with my electron app. The installation was successful but keep getting this error on start.

App threw an error during load
Error: dlopen(/Users/danielbamidele/csuite/release/app/node_modules/better-sqlite3/build/Release/better_sqlite3.node, 0x0001): tried: '/Users/danielbamidele/csuite/release/app/node_modules/better-sqlite3/build/Release/better_sqlite3.node' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/danielbamidele/csuite/release/app/node_modules/better-sqlite3/build/Release/better_sqlite3.node' (no such file), '/Users/danielbamidele/csuite/release/app/node_modules/better-sqlite3/build/Release/better_sqlite3.node' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))
    at process.func [as dlopen] (node:electron/js2c/asar_bundle:2:1869)
    at Object.<anonymous> (node:internal/modules/cjs/loader:1356:18)
    at Object.func [as .node] (node:electron/js2c/asar_bundle:2:1869)
    at Module.load (node:internal/modules/cjs/loader:1126:32)
    at node:internal/modules/cjs/loader:967:12
    at Function.<anonymous> (node:electron/js2c/asar_bundle:2:13377)
    at Function.Module._load (/Users/danielbamidele/csuite/node_modules/runtime-required/runtime-required.js:34:23)
    at Module.require (node:internal/modules/cjs/loader:1150:19)
    at require (node:internal/modules/cjs/helpers:110:18)
    at bindings (/Users/danielbamidele/csuite/release/app/node_modules/bindings/bindings.js:112:48)

I have tried quite a few suggestions to fix this including running DEBUG=electron-builder ./node_modules/.bin/electron-builder build --mac --arm64 postinstall. Nothing seems to be working.

I'll really appreciate any help here. Thanks.

I'm trying to import better-sqlite3 but I have a problem when I try to use it with an electron app.

When I add this:
import Database from "better-sqlite3";

I get:

App threw an error during load
Error: Could not dynamically require "C:\Users\myuser\windev\project\build\better_sqlite3.node". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.
    at ne (C:\Users\myuser\windev\project\.vite\build\main.js:1:526)
    at h (C:\Users\myuser\windev\project\.vite\build\main.js:1:3441)
    at new m (C:\Users\myuser\windev\project\.vite\build\main.js:3:12762)
    at Object.<anonymous> (C:\Users\myuser\windev\project\.vite\build\main.js:3:13759)
    at Module._compile (node:internal/modules/cjs/loader:1271:14)
    at Object..js (node:internal/modules/cjs/loader:1326:10)
    at Module.load (node:internal/modules/cjs/loader:1126:32)
    at node:internal/modules/cjs/loader:967:12
    at Function._load (node:electron/js2c/asar_bundle:2:13327)
    at loadApplicationPackage (C:\Users\myuser\windev\project\node_modules\electron\dist\resources\default_app.asar\main.js:121:16)

Using:

  • Node v20.9.0
  • Windows 11
  • electron (27.0.4) forge (6.4.2) with the vite plugin.

I tried several answers here without making it work.
Anything I'm missing?

I'm trying to import better-sqlite3 but I have a problem when I try to use it with an electron app.

When I add this: import Database from "better-sqlite3";

I get:

App threw an error during load
Error: Could not dynamically require "C:\Users\myuser\windev\project\build\better_sqlite3.node". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.
    at ne (C:\Users\myuser\windev\project\.vite\build\main.js:1:526)
    at h (C:\Users\myuser\windev\project\.vite\build\main.js:1:3441)
    at new m (C:\Users\myuser\windev\project\.vite\build\main.js:3:12762)
    at Object.<anonymous> (C:\Users\myuser\windev\project\.vite\build\main.js:3:13759)
    at Module._compile (node:internal/modules/cjs/loader:1271:14)
    at Object..js (node:internal/modules/cjs/loader:1326:10)
    at Module.load (node:internal/modules/cjs/loader:1126:32)
    at node:internal/modules/cjs/loader:967:12
    at Function._load (node:electron/js2c/asar_bundle:2:13327)
    at loadApplicationPackage (C:\Users\myuser\windev\project\node_modules\electron\dist\resources\default_app.asar\main.js:121:16)

Using:

  • Node v20.9.0
  • Windows 11
  • electron (27.0.4) forge (6.4.2) with the vite plugin.

I tried several answers here without making it work. Anything I'm missing?

I had the same issue. I fixed it by externalizing 'better-sqlite3' in Vite's config:

import { defineConfig } from "vite";
import builtInModules from "builtin-modules";

export default defineConfig({
	build: {
		// ...
		rollupOptions: {
			external: [...builtInModules, "electron", "better-sqlite3"],
			// ...
		},
	},
});

Am I stupid? I can't find a node version that corresponds with NODE_MODULE_VERSION 113, as far as I can tell node 19 is 111 and node 20 is 115. electron-rebuild permutations are not working for me. This is using latest 9.1.1

 The module '/home/runner/work/sentient-sims-app/sentient-sims-app/release/app/node_modules/better-sqlite3/build/Release/better_sqlite3.node'
    was compiled against a different Node.js version using
    NODE_MODULE_VERSION 113. This version of Node.js requires
    NODE_MODULE_VERSION 108. Please try re-compiling or re-installing
    the module (for instance, using `npm rebuild` or `npm install`).

@guspuffygit I'm not sure what exactly your goal is because according to that error, it's compiled for Electron v23 (NODE_MODULE_VERSION 113) but it's trying to run on Node v18 (NODE_MODULE_VERSION 108). electron-rebuild seem to be doing its job if you're using Electron v23. If you want to run the application on plain Node v18, run npm rebuild.

Check these references:
https://nodejs.org/en/about/previous-releases
https://releases.electronjs.org/releases.json

Thank you @m4heshd I figured it out.

It was compiling correctly with the correct electron binaries. My issue was when running the jest test it was running jest with node (108) instead of electron which is where the error was happening. I was able to fix my issue by running jest using electron:

ELECTRON_RUN_AS_NODE=true ./node_modules/.bin/electron ./node_modules/.bin/jest

I have this error:

#1111

How could I fix it?

Does anyone have any instructions on how to install better-sqlite3 on Electron
electron: 26.2.1
running on a mac with node 16.
I've tried all of the above and keep getting errors.

Answering my own question I found this very helpful in SO:
https://stackoverflow.com/a/69960505/2690257
yarn add better-sqlite3; cd node_modules/better-sqlite3; ../.bin/electron-rebuild cd ../.. npm run start

I'm using esbuild, but not using electron. The solution for me was to add the following loader:

/**
 * rewrites code like `require('bindings')('better_sqlite3.node')`
 * in dependencies to `require('<package_name>/build/Release/better_sqlite3.node')` so that it is
 * picked up by esbuild and correctly found at runtime.
 *
 * Without this, we have two problems:
 *
 * 1. the native addon is not included in the bundle
 * 2. we get this error at runtime: "Could not find module root given file: \"/var/task/index.js\". Do you have a `package.json` file?"
 */
class BindingsRewritePlugin {
  name = 'bindings-rewrite-plugin'

  /** @param {esbuild.PluginBuild} build */
  setup(build) {
    const BINDINGS_PATTERN = /require\(["']bindings["']\)\('([\w-]+.node)'\)/
    build.onLoad({ filter: /\.js$/ }, async args => {
      const contents = await fs.readFile(args.path, 'utf8')
      if (!BINDINGS_PATTERN.test(contents)) return

      // path is an absolute path to the file, so we need to first find the node_modules directory
      const pathParts = args.path.split(path.sep)
      const nodeModulesIndex = pathParts.indexOf('node_modules')
      const packageName = pathParts[nodeModulesIndex + 1]

      const rewritten = contents.replace(
        BINDINGS_PATTERN,
        `require('${packageName}/build/Release/$1')`
      )
      return { contents: rewritten, loader: 'js' }
    })
  }
}

and the following to the esbuild config:

{
    ...
    plugins: [new BindingsRewritePlugin()],
    loader: {
      '.node': 'copy',
    },
  }

the bindings package is literally just a hardcoded list of different requires to try, and these days, in practice, it seems like it is sufficient to only look in build/Release/foo.node

I was constantly getting TypeError: Cannot read properties of null (reading 'indexOf') from bindings package while using webpack5. The bindings package is just throwing a dummy exception and parsing the stack trace but for some reason the stack trace for me was:

[
  CallSite {}, CallSite {},
  CallSite {}, CallSite {},
  CallSite {}, CallSite {},
  CallSite {}, CallSite {},
  CallSite {}, CallSite {}
]

And thus breaking bindings.getFileName(). Considering bindings package hasn't been updated in 5 years, I doubt this issue will ever get resolved.

Instead I decided to just manually load the bindings:

    import BetterSqlite3 from 'better-sqlite3'

    // eslint-disable-next-line @typescript-eslint/no-var-requires
    const nativeBinding = require('better-sqlite3/build/Release/better_sqlite3.node') as string // technically an object but the nativeBinding field is typed as string | undefined

    const client = new BetterSqlite3(':memory:', {
        nativeBinding,
    })

This also requires node-loader plugin for webpack

    module: {
        rules: [
            {
                test: /\.node$/,
                loader: 'node-loader',
            },
        ],
    },

For anyone bundling with esbuild just add --external:better-sqlite3. It worked for me, here's the whole command:

esbuild foo.js --outdir=bar --bundle --platform=node --external:better-sqlite3

Hope this helps.

If you use Docker, then check out my solution.

I solved it by installing better-sqlite3 in Dockerfile instead of package.json & using pnpm's supportedArchitectures feature.

Hello together,

I'm new to Electron and vite and would like to get it running with sqlite3 or better-sqlite3. As I had many issues with sqlite3 due to either not compatible with vite in one version but also not compatible with eletron-builder with newer version I decided to use better-sqlite3 which basically solves some of my issues with vite and electron-builder

Now I'm stucked at the point:

Error: Could not dynamically require "C:\workspace\electron-typescript-template_two\build\better_sqlite3.node".

Hope someone here could help me get this running.

This is my package.json

{
  "name": "electron-typescript-template",
  "version": "0.0.1",
  "description": "This is an electron typescript template",
  "private": true,
  "main": "./dist-electron/main.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "build": "tsc && vite build",
    "start": "tsc && vite",
    "dist": "electron-builder"
  },
  "author": "David",
  "license": "UNLICENSED",
  "devDependencies": {
    "builtin-modules": "^3.3.0",
    "electron": "^29.1.0",
    "electron-builder": "^22.2.0",
    "typescript": "^5.3.3",
    "vite": "^5.1.4",
    "vite-plugin-electron": "^0.28.2",
    "vite-plugin-electron-renderer": "^0.14.5"
  },
  "build": {
    "appId": "com.wanner.electron-typescript-template",
    "files": [
      "dist-electron",
      "dist"
    ],
    "mac": {
      "category": "your.app.category.type"
    },
    "directories": {
      "output": "build/Release/${version}"
    }
  },
  "debug": {
    "env": {
      "VITE_DEV_SERVER_URL": "http://127.0.0.1:7777"
    }
  },
  "dependencies": {
    "@types/jquery": "^3.5.29",
    "better-sqlite3": "^9.4.3",
    "jquery": "^3.7.1"
  }
}

this is my vite.config.ts

import { defineConfig } from 'vite';
import electron from 'vite-plugin-electron/simple'
import builtInModules from 'builtin-modules';

export default defineConfig({
  plugins: [
    electron({
      main: {
        // Shortcut of `build.lib.entry`
        entry: 'app/electron/main.ts',
      },
      preload: {
        // Shortcut of `build.rollupOptions.input`
        input: 'app/electron/preload.ts',
      },
      // Optional: Use Node.js API in the Renderer process
      renderer: {},
    }),
  ],
});

adding the following lines to vite.config.ts doesn't solve my issue

build: {
   rollupOptions: {
      external: [...builtInModules, "electron", "better-sqlite3"],
   },
}

For electron-builder I'm getting following issues:

prebuild-install http 404 https://github.com/WiseLibs/better-sqlite3/releases/download/v9.4.3/better-sqlite3-v9.4.3-electron-v121-win32-x64.tar.gz
prebuild-install warn install No prebuilt binaries found (target=29.1.0 runtime=electron arch=x64 libc= platform=win32)

Am using node 18.18.0, electron ^29.0.0, electron-builder ^24.13.3, vite ^5.2.8, better-sqlite3 ^9.4.5. I'm using electron-builder install-app-deps which fetches the prebuilt bindings successfully.

I've had this issue in the past but can't remember how I fixed it. For some reason electron seems to be searching in the root of the project for the bindings, but the actual binding exists in node_modules/better-sqlite3/build/Release/better_sqlite3.node, so I'm wondering why bindings.js isn't looking in there.

Uncaught (in promise) Error: Could not locate the bindings file. Tried:
 → C:\Users\Jaz\Repos\bar-lobby\build\better_sqlite3.node
 → C:\Users\Jaz\Repos\bar-lobby\build\Debug\better_sqlite3.node
 → C:\Users\Jaz\Repos\bar-lobby\build\Release\better_sqlite3.node
 → C:\Users\Jaz\Repos\bar-lobby\out\Debug\better_sqlite3.node
 → C:\Users\Jaz\Repos\bar-lobby\Debug\better_sqlite3.node
 → C:\Users\Jaz\Repos\bar-lobby\out\Release\better_sqlite3.node
 → C:\Users\Jaz\Repos\bar-lobby\Release\better_sqlite3.node
 → C:\Users\Jaz\Repos\bar-lobby\build\default\better_sqlite3.node
 → C:\Users\Jaz\Repos\bar-lobby\compiled\20.9.0\win32\x64\better_sqlite3.node
 → C:\Users\Jaz\Repos\bar-lobby\addon-build\release\install-root\better_sqlite3.node
 → C:\Users\Jaz\Repos\bar-lobby\addon-build\debug\install-root\better_sqlite3.node
 → C:\Users\Jaz\Repos\bar-lobby\addon-build\default\install-root\better_sqlite3.node
 → C:\Users\Jaz\Repos\bar-lobby\lib\binding\node-v121-win32-x64\better_sqlite3.node
    at bindings (bindings.js:126:9)
    at new Database (database.js:48:45)
    at new CacheDbAPI (cache-db.ts:32:27)

Have tried deleting node_modules and package-lock. Tried to configure the nativeBinding property on the Database instatiation but I'm not sure how to do that using import.meta syntax (which my project needs instead of require).

Copying the binding manually to the root folder does fix the issue, but it feels hacky and I'll need to do it dynamically for contributors using different architectures. Am more curious about the exact cause of the issue.

Also, as a side note, this mega-thread is pretty awful for finding answers relevant to my specific problem. There are other issues which are more specific but they got closed in favour of this one, but it's full of tons of people with different problems and a bunch of them are hidden so it's difficult to find relevant solutions. I'd recommend allowing each specific error to exist as its own issue.

I had no luck by directly running electron-rebuild. I had to change some build configurations.

Inside package.json,

build {
    "npmRebuild": true,
    "buildDependenciesFromSource": true,
}

Now, run electron-rebuild. This will build better-sqlite3 from source for your electron and node versions. Build will take some time. So, second time change the configuration to :

build {
    "npmRebuild": false,
    "buildDependenciesFromSource": false,
}

This configuration will not build from source or download pre-built binary of better-sqlite3. It will take the binary from the first run of electron-rebuild.

jdeg commented

Could not dynamically require "better_sqlite3.node" #1102

Did you find the root of this problem? I have a similar issue using Knex. I tried to use nativeBinding but it seems to ignore it.