Help me use Electron!

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.

As a potentially helpful start to this thread, I'd like to contribute that many people have had their issues resolved by using electron-rebuild

I'm using both Electron and Windows so I'm happy to chime in here. I'm still using a custom fork but I think you resolved my PRs a while ago so I need to try master again. I'll let you know what we should document about Electron (at the very least, just like any native module, you do need to rebuild it for electron and electron-rebuild works great)

I,m still had this error even with electron rebuild
here my package.json
{
  "name": "sqlite-electron",
  "version": "1.0.0",
  "main": "index.js",
  "scripts": {
    "start": "electron .",
    "rebuild": "electron-rebuild -f -w better-sqlite3",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "description": "",
  "dependencies": {
    "better-sqlite3": "^4.1.4",
    "electron": "^2.0.2"
  },
  "devDependencies": {
    "electron-rebuild": "^1.7.3"
  }
}

OS: Linux Ubuntu Based
node 8.11.1 using nvm

I can help all our projects are using electron and better-sqlite3
this is our readme
/////////////////////////////////////////////
SETUP AND INSTALL SQL MODULE
/////////////////////////////////////////////
better-sqlite3 instructios
npm install -g windows-build-tools(might need to installl python and add the dir to the env file in windwos)
npm install --save better-sqlite3
npm install --save-dev electron-rebuild
go to terminal in the vs and run
node_modules/.bin/electron-rebuild -f -w better-sqlite3

It may be best to use nvm and set the same node version to match the version in electron... depending on what/how you are running functional/integration testing, you may still need the version against your framework outside electron.

Hello,
I want to display some data using a renderer process and accessing a database; the database is open in the main process. I'm trying to pass the database variable from the main to the renderer using ipcRenderer but when I try to call db.prepare() in the renderer i get the error:
"db.prepare is not a function"
Searching throw stackoverflow it seems that the reason is that Electron's IPC only sends serializable object and Database is not (I'm not really sure about this).
How can I pass the database from the main to the renderer?

Where it doesn't work for you even with the windows-build-tools, here is the fix :

Install Visual Studio Installer
Modify Visual Studio Build Tools 2017 (or install if you don't have)
Inside Visual C++ Build Tools, tick VC++ 2015.3 v14.00 (v140) toolset
Push the Install button (or Modify)
Retry running npm install better-sqlite3
Run node_modules/.bin/electron-rebuild -f -w better-sqlite3

And there you go, you can run your app.

@LucaPizzagalli You can't send database objects across IPC channels, but you can send a filename string, which you can then use to open the same database within your renderer process.

@JoshuaWise > You can't send database objects across IPC channels, but you can send a filename (string), which you can then use to open the same database within your renderer process.
Would you clarify -- is it true that better-sqlite3 operations called in renderer processes must make remote calls to the main process, and so the main process actually does all database access? Or can renderer processes use better-sqlite3 completely in-process?

In my case node_modules/.bin/electron-rebuild -f -w better-sqlite3 results in this error: https://gist.github.com/barbalex/a40e40900279c0021541e8229d2a25fb
which seems to basically be:
In file included from ../src/addon.cpp:2:
../src/addon.h:21:15: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
        node::MakeCallback(isolate, isolate->GetCurrentContext()->Global(), Local<Function>::New(isolate, noop), 0, nullptr);

I have the feeling that node versions are involved, but absolutely no idea how to solve this.
It may be related to the fact that when I run yarn dev, electron starts up but this error appears in the dev tools:
/Users/alexandergabriel/awel-personal/app/node_modules/bindings/bindings.js:88 Uncaught Error: The module '/Users/alexandergabriel/awel-personal/app/node_modules/better-sqlite3/build/Release/better_sqlite3.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 64. This version of Node.js requires
NODE_MODULE_VERSION 69. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:160:31)
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:722)
    at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:160:31)
    at Module.load (internal/modules/cjs/loader.js:602)
    at tryModuleLoad (internal/modules/cjs/loader.js:541)
    at Function.Module._load (internal/modules/cjs/loader.js:533)
    at Module.require (internal/modules/cjs/loader.js:640)
    at require (internal/modules/cjs/helpers.js:20)
    at bindings (/Users/alexandergabriel/awel-personal/app/node_modules/bindings/bindings.js:81)
    at Object.<anonymous> (/Users/alexandergabriel/awel-personal/app/node_modules/better-sqlite3/lib/database.js:4)

Which is why I tried to run electron-rebuild in the first place.
But no number of rm yarn.lock && rm -rf node_modules && yarn cache clean && yarn has helped.

I had this problem once I built it with the wrong version. Delete your entire Node folder download electron first then better sqlite 3 then try and build. or it could be electron then electron rebuild then sqlite.

Hello,
I want to display some data using a renderer process and accessing a database; the database is open in the main process. I'm trying to pass the database variable from the main to the renderer using ipcRenderer but when I try to call db.prepare() in the renderer i get the error:
"db.prepare is not a function"
Searching throw stackoverflow it seems that the reason is that Electron's IPC only sends serializable object and Database is not (I'm not really sure about this).
How can I pass the database from the main to the renderer?

so what we have done is we set up a worker file.. and the worker file will talk to the DB.. you should never run anything on the main thread.. as it causes a lock up on the clients PC. It took us a while to get this working properly XD.  we use our main thread for only page changes and connections to the server. Everything else is run through our worker.

From the last version (5.4.0), i'm not able to run my project, even if I rebuild with npm rebuild better-sqlite3 --build-from-source
here's the error when I run the project (no error during compilation)
┏ Electron -------------------

  dyld: lazy symbol binding failed: Symbol not found: __ZN2v814ObjectTemplate11SetAccessorENS_5LocalINS_6StringEEEPFvS3_RKNS_20PropertyCallbackInfoINS_5ValueEEEEPFvS3_NS1_IS5_EERKNS4_IvEEESB_NS_13AccessControlENS_17PropertyAttributeENS1_INS_17AccessorSignatureEEE
    Referenced from: /Users/ST/project/node_modules/integer/build/integer.node
    Expected in: flat namespace

  dyld: Symbol not found: __ZN2v814ObjectTemplate11SetAccessorENS_5LocalINS_6StringEEEPFvS3_RKNS_20PropertyCallbackInfoINS_5ValueEEEEPFvS3_NS1_IS5_EERKNS4_IvEEESB_NS_13AccessControlENS_17PropertyAttributeENS1_INS_17AccessorSignatureEEE
    Referenced from: /Users/ST/project/node_modules/integer/build/integer.node
    Expected in: flat namespace

┗ ----------------------------

Tried with :

Node v11.10.0
Node v10.15.1
Node v10.9.0
Node v10.0.0
I must use NODE_MODULE_VERSION 64 anyway.

I need help... (electron v4.0.3)

I used the exact same command as barbalex and I received this error: https://gist.github.com/x-Aizawa/cff50adb7f9d4358e35b074a7b89dd42
It seems like the error is different than his/her so I haven't tried the solution provided by Custardcs.
Any help would be appreciated.

I used the exact same command as barbalex and I received this error: https://gist.github.com/x-Aizawa/cff50adb7f9d4358e35b074a7b89dd42
It seems like the error is different than his/her so I haven't tried the solution provided by Custardcs.
Any help would be appreciated.

You need to install electron version 4.0.3, because since 4.0.4, no node version is high enough to fulfill the 69 version requirement.
as seen here : https://nodejs.org/en/download/releases, the last NODE_MODULE_VERSION is currently 67 for the last version (11.10.0).
If you want to use electron 4.0.3, you'll need to install node v10.15.1

I used the exact same command as barbalex and I received this error: https://gist.github.com/x-Aizawa/cff50adb7f9d4358e35b074a7b89dd42
It seems like the error is different than his/her so I haven't tried the solution provided by Custardcs.
Any help would be appreciated.

You need to install electron version 4.0.3, because since 4.0.4, no node version is high enough to fulfill the 69 version requirement.
as seen here : https://nodejs.org/en/download/releases, the last NODE_MODULE_VERSION is currently 67 for the last version (11.10.0).
If you want to use electron 4.0.3, you'll need to install node v10.15.1

Im using version 4.0.4 without any issues

I used the exact same command as barbalex and I received this error: https://gist.github.com/x-Aizawa/cff50adb7f9d4358e35b074a7b89dd42
It seems like the error is different than his/her so I haven't tried the solution provided by Custardcs.
Any help would be appreciated.

can you give me a step by step example of what you have done.. from fresh project to here? so maybe i can help better

I used the exact same command as barbalex and I received this error: https://gist.github.com/x-Aizawa/cff50adb7f9d4358e35b074a7b89dd42
It seems like the error is different than his/her so I haven't tried the solution provided by Custardcs.
Any help would be appreciated.

can you give me a step by step example of what you have done.. from fresh project to here? so maybe i can help better

I made an application and finished everything, decided to add SQLite to my application and those errors appear when installing/running app/using electron-rebuild.
I'll try to downgrade the version for Electron.

I used the exact same command as barbalex and I received this error: https://gist.github.com/x-Aizawa/cff50adb7f9d4358e35b074a7b89dd42
It seems like the error is different than his/her so I haven't tried the solution provided by Custardcs.
Any help would be appreciated.

can you give me a step by step example of what you have done.. from fresh project to here? so maybe i can help better

I made an application and finished everything, decided to add SQLite to my application and those errors appear when installing/running app/using electron-rebuild.
I'll try to downgrade the version for Electron.

Show me your package.json,

I see it says 'invalid file or disk full' you have enough space on your disk right?

{
  "name": "bank-account",
  "version": "1.0.0",
  "main": "main.js",
  "scripts": {
    "start": "electron ."
  },
  "author": "uBakkar",
  "devDependencies": {
    "electron": "^4.0.5",
    "electron-rebuild": "^1.8.4"
  },
  "dependencies": {
    "better-sqlite3": "^5.4.0",
    "electron-reload": "^1.4.0",
    "enmap": "^4.8.1",
    "moment": "^2.24.0"
  }
}

Yes, I have 300GB free.

@SwiTool - @Custardcs | I downgraded to v4.0.3 and this error appeared:
Error: The module '\\?\C:\Private\Bank-Application\node_modules\better-sqlite3\build\better_sqlite3.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 64. This version of Node.js requires
NODE_MODULE_VERSION 69. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:160:31)
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:722:18)
    at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:160:31)
    at Module.load (internal/modules/cjs/loader.js:602:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:541:12)
    at Function.Module._load (internal/modules/cjs/loader.js:533:3)
    at Module.require (internal/modules/cjs/loader.js:640:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (C:\Private\Bank-Application\node_modules\better-sqlite3\lib\database.js:5:21)
    at Object.<anonymous> (C:\Private\Bank-Application\node_modules\better-sqlite3\lib\database.js:57:3)

{
  "name": "bank-account",
  "version": "1.0.0",
  "main": "main.js",
  "scripts": {
    "start": "electron ."
  },
  "author": "uBakkar",
  "devDependencies": {
    "electron": "^4.0.5",
    "electron-rebuild": "^1.8.4"
  },
  "dependencies": {
    "better-sqlite3": "^5.4.0",
    "electron-reload": "^1.4.0",
    "enmap": "^4.8.1",
    "moment": "^2.24.0"
  }
}

Yes, I have 300GB free.

Im assuming you are on windows?

@SwiTool - @Custardcs | I downgraded to v4.0.3 and this error appeared:
Error: The module '\\?\C:\Private\Bank-Application\node_modules\better-sqlite3\build\better_sqlite3.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 64. This version of Node.js requires
NODE_MODULE_VERSION 69. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:160:31)
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:722:18)
    at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:160:31)
    at Module.load (internal/modules/cjs/loader.js:602:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:541:12)
    at Function.Module._load (internal/modules/cjs/loader.js:533:3)
    at Module.require (internal/modules/cjs/loader.js:640:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (C:\Private\Bank-Application\node_modules\better-sqlite3\lib\database.js:5:21)
    at Object.<anonymous> (C:\Private\Bank-Application\node_modules\better-sqlite3\lib\database.js:57:3)

delete all your nodemodules and follow the steps up above look at my post near the top.
Windows PowerShell
Copyright (C) 2015 Microsoft Corporation. All rights reserved.

PS C:\Users\CuntarD\Documents\Test> npm i electron

><EMAIL_ADDRESS>postinstall C:\Users\CuntarD\Documents\Test\node_modules\electron
> node install.js

npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN<EMAIL_ADDRESS>No description
npm WARN<EMAIL_ADDRESS>No repository field.
npm WARN<EMAIL_ADDRESS>No license field.

+<EMAIL_ADDRESS>added 145 packages from 139 contributors and audited 201 packages in 9.831s
found 0 vulnerabilities

PS C:\Users\CuntarD\Documents\Test>
PS C:\Users\CuntarD\Documents\Test> npm i electron-rebuild
npm WARN<EMAIL_ADDRESS>No description
npm WARN<EMAIL_ADDRESS>No repository field.
npm WARN<EMAIL_ADDRESS>No license field.

+<EMAIL_ADDRESS>added 109 packages from 60 contributors and audited 496 packages in 7.453s
found 0 vulnerabilities

PS C:\Users\CuntarD\Documents\Test> npm i better-sqlite3

><EMAIL_ADDRESS>install C:\Users\CuntarD\Documents\Test\node_modules\integer
> node-gyp rebuild

C:\Users\CuntarD\Documents\Test\node_modules\integer>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  integer.cpp
  win_delay_load_hook.cc
c:\users\cuntard\documents\test\node_modules\integer\src\integer.cpp(370): warning C4804: '-': unsafe use of type 'bool' in operation [C:\Users\CuntarD\Documents\Test\node_modules\integer\build\integer.vcxproj]
     Creating library C:\Users\CuntarD\Documents\Test\node_modules\integer\build\Release\integer.lib and object C:\Users\CuntarD\Documents\Test\node_modules\integer\build\Release\integer.exp
  Generating code
  All 265 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
  Finished generating code
  integer.vcxproj -> C:\Users\CuntarD\Documents\Test\node_modules\integer\build\Release\\integer.node
  Copying C:\Users\CuntarD\Documents\Test\node_modules\integer\build\Release\/integer.node to build\integer.node
          1 file(s) copied.

><EMAIL_ADDRESS>install C:\Users\CuntarD\Documents\Test\node_modules\better-sqlite3
> node-gyp rebuild

C:\Users\CuntarD\Documents\Test\node_modules\better-sqlite3>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  extract_sqlite3
  sqlite3.c
  win_delay_load_hook.cc
  sqlite3.vcxproj -> C:\Users\CuntarD\Documents\Test\node_modules\better-sqlite3\build\Release\\sqlite3.lib
  better_sqlite3.cpp
  win_delay_load_hook.cc
     Creating library C:\Users\CuntarD\Documents\Test\node_modules\better-sqlite3\build\Release\better_sqlite3.lib and object C:\Users\CuntarD\Documents\Test\node_modules\better-sqlite3\build\Release\better_sqlite3.exp
  Generating code
  All 4285 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
  Finished generating code
  better_sqlite3.vcxproj -> C:\Users\CuntarD\Documents\Test\node_modules\better-sqlite3\build\Release\\better_sqlite3.node
  better_sqlite3.vcxproj -> C:\Users\CuntarD\Documents\Test\node_modules\better-sqlite3\build\Release\better_sqlite3.pdb (Full PDB)
  test_extension.c
  win_delay_load_hook.cc
  Generating code
  All 2 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
  Finished generating code
  test_extension.vcxproj -> C:\Users\CuntarD\Documents\Test\node_modules\better-sqlite3\build\Release\\test_extension.node
  test_extension.vcxproj -> C:\Users\CuntarD\Documents\Test\node_modules\better-sqlite3\build\Release\test_extension.pdb (Full PDB)
  Copying C:\Users\CuntarD\Documents\Test\node_modules\better-sqlite3\build\Release\/better_sqlite3.node to build\better_sqlite3.node
          1 file(s) copied.
  Copying C:\Users\CuntarD\Documents\Test\node_modules\better-sqlite3\build\Release\/test_extension.node to build\test_extension.node
          1 file(s) copied.
npm WARN<EMAIL_ADDRESS>No description
npm WARN<EMAIL_ADDRESS>No repository field.
npm WARN<EMAIL_ADDRESS>No license field.

+<EMAIL_ADDRESS>added 8 packages from 2 contributors and audited 515 packages in 33.737s
found 0 vulnerabilities

PS C:\Users\CuntarD\Documents\Test> npm i electron-reload
npm WARN<EMAIL_ADDRESS>No description
npm WARN<EMAIL_ADDRESS>No repository field.
npm WARN<EMAIL_ADDRESS>No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY<EMAIL_ADDRESS>(node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for<EMAIL_ADDRESS>wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+<EMAIL_ADDRESS>added 131 packages from 105 contributors and audited 2630 packages in 18.649s
found 0 vulnerabilities

PS C:\Users\CuntarD\Documents\Test> npm i enmap
npm WARN<EMAIL_ADDRESS>requires a peer of better-sqlite-pool@github:eslachance/better-sqlite-pool but none is installed. You must install peer dependencies yourself.
npm WARN<EMAIL_ADDRESS>No description
npm WARN<EMAIL_ADDRESS>No repository field.
npm WARN<EMAIL_ADDRESS>No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY<EMAIL_ADDRESS>(node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for<EMAIL_ADDRESS>wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+<EMAIL_ADDRESS>added 2 packages from 3 contributors and audited 2632 packages in 8.086s
found 0 vulnerabilities

PS C:\Users\CuntarD\Documents\Test> npm i moment
npm WARN<EMAIL_ADDRESS>requires a peer of better-sqlite-pool@github:eslachance/better-sqlite-pool but none is installed. You must install peer dependencies yourself.
npm WARN<EMAIL_ADDRESS>No description
npm WARN<EMAIL_ADDRESS>No repository field.
npm WARN<EMAIL_ADDRESS>No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY<EMAIL_ADDRESS>(node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for<EMAIL_ADDRESS>wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+<EMAIL_ADDRESS>added 1 package from 6 contributors and audited 2633 packages in 4.569s
found 0 vulnerabilities

PS C:\Users\CuntarD\Documents\Test>

everything complied fine.

It's compiling and everything, but when I try to run the application I receive an error.

@Custardcs | Yes, I use Windows.

Another thing is that I'm not using better-sqlite3 directly, but better-sqlite-pool which is based off better-sqlite3 and the error says better-sqlite3.

Another thing is that I'm not using better-sqlite3 directly, but better-sqlite-pool which is based off better-sqlite3 and the error says better-sqlite3.

then im not sure bud i have not used 'better-sqlite-pool' last thing i can suggest is giving me a copy of you project and ill try run it on my side.

Sure, I'll make a GitHub private repository and add you as a collaborator or whatever it's called.

Another thing is that I'm not using better-sqlite3 directly, but better-sqlite-pool which is based off better-sqlite3 and the error says better-sqlite3.

then im not sure bud i have not used 'better-sqlite-pool' last thing i can suggest is giving me a copy of you project and ill try run it on my side.

You have been sent an invitation to a private repository with the name "Electron-Application".

@Custardcs | Hey?

@Custardcs | Hey?

Hey bro. Been a busy day. Ill test it out now

@Custardcs | Hey?

Hey bro. Been a busy day. Ill test it out now

Great, please reply to me when you're back.

I dont have access to the repository

Hmm, I sent an invitation to you.

so its working

here is the full log in the order I did everything.,
Windows PowerShell
Copyright (C) 2015 Microsoft Corporation. All rights reserved.

PS C:\Users\CuntarD\Desktop\Electron-Application-master> npm i electron

><EMAIL_ADDRESS>postinstall C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\electron
> node install.js

npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN<EMAIL_ADDRESS>No repository field.
npm WARN<EMAIL_ADDRESS>No license field.

+<EMAIL_ADDRESS>added 145 packages from 139 contributors and audited 201 packages in 14.411s
found 0 vulnerabilities

PS C:\Users\CuntarD\Desktop\Electron-Application-master> npm i better-sqlite-pool

><EMAIL_ADDRESS>install C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\integer
> node-gyp rebuild

C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\integer>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )
else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  integer.cpp
  win_delay_load_hook.cc
c:\users\cuntard\desktop\electron-application-master\node_modules\integer\src\integer.cpp(370): warning C4804: '-': unsafe use of type 'bool' in operation [C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\integer\build\integer.vcxproj]
     Creating library C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\integer\build\Release\integer.lib and object C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\integer\build\Release\integer.exp
  Generating code
  All 265 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
  Finished generating code
  integer.vcxproj -> C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\integer\build\Release\\integer.node
  Copying C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\integer\build\Release\/integer.node to build\integer.node
          1 file(s) copied.

><EMAIL_ADDRESS>install C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\better-sqlite3
> node-gyp rebuild

C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\better-sqlite3>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  extract_sqlite3
  sqlite3.c
  win_delay_load_hook.cc
  sqlite3.vcxproj -> C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\better-sqlite3\build\Release\\sqlite3.lib
  better_sqlite3.cpp
  win_delay_load_hook.cc
     Creating library C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\better-sqlite3\build\Release\better_sqlite3.lib and object C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\better-sqlite3\build\Release\better_sqli
  te3.exp
  Generating code
  All 4285 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
  Finished generating code
  better_sqlite3.vcxproj -> C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\better-sqlite3\build\Release\\better_sqlite3.node
  better_sqlite3.vcxproj -> C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\better-sqlite3\build\Release\better_sqlite3.pdb (Full PDB)
  test_extension.c
  win_delay_load_hook.cc
  Generating code
  All 2 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
  Finished generating code
  test_extension.vcxproj -> C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\better-sqlite3\build\Release\\test_extension.node
  test_extension.vcxproj -> C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\better-sqlite3\build\Release\test_extension.pdb (Full PDB)
  Copying C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\better-sqlite3\build\Release\/better_sqlite3.node to build\better_sqlite3.node
          1 file(s) copied.
  Copying C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\better-sqlite3\build\Release\/test_extension.node to build\test_extension.node
          1 file(s) copied.
npm WARN<EMAIL_ADDRESS>No repository field.
npm WARN<EMAIL_ADDRESS>No license field.

+<EMAIL_ADDRESS>added 11 packages from 8 contributors and audited 223 packages in 39.568s
found 0 vulnerabilities

PS C:\Users\CuntarD\Desktop\Electron-Application-master> npm i electron-reload
npm WARN<EMAIL_ADDRESS>No repository field.
npm WARN<EMAIL_ADDRESS>No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY<EMAIL_ADDRESS>(node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for<EMAIL_ADDRESS>wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+<EMAIL_ADDRESS>added 132 packages from 105 contributors and audited 2338 packages in 10.515s
found 0 vulnerabilities

PS C:\Users\CuntarD\Desktop\Electron-Application-master> npm i enmap
npm WARN<EMAIL_ADDRESS>requires a peer of better-sqlite-pool@github:eslachance/better-sqlite-pool but none is installed. You must install peer dependencies yourself.
npm WARN<EMAIL_ADDRESS>No repository field.
npm WARN<EMAIL_ADDRESS>No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY<EMAIL_ADDRESS>(node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for<EMAIL_ADDRESS>wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+<EMAIL_ADDRESS>added 2 packages from 3 contributors and audited 2340 packages in 6.579s
found 0 vulnerabilities

PS C:\Users\CuntarD\Desktop\Electron-Application-master> npm i moment
npm WARN<EMAIL_ADDRESS>requires a peer of better-sqlite-pool@github:eslachance/better-sqlite-pool but none is installed. You must install peer dependencies yourself.
npm WARN<EMAIL_ADDRESS>No repository field.
npm WARN<EMAIL_ADDRESS>No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY<EMAIL_ADDRESS>(node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for<EMAIL_ADDRESS>wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+<EMAIL_ADDRESS>added 1 package from 6 contributors and audited 2341 packages in 5.176s
found 0 vulnerabilities

PS C:\Users\CuntarD\Desktop\Electron-Application-master> npm rebuild

><EMAIL_ADDRESS>install C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\better-sqlite3
> node-gyp rebuild

C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\better-sqlite3>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  extract_sqlite3
  sqlite3.c
  win_delay_load_hook.cc
  sqlite3.vcxproj -> C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\better-sqlite3\build\Release\\sqlite3.lib
  better_sqlite3.cpp
  win_delay_load_hook.cc
     Creating library C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\better-sqlite3\build\Release\better_sqlite3.lib and object C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\better-sqlite3\build\Release\better_sqli
  te3.exp
  Generating code
  All 4285 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
  Finished generating code
  better_sqlite3.vcxproj -> C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\better-sqlite3\build\Release\\better_sqlite3.node
  better_sqlite3.vcxproj -> C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\better-sqlite3\build\Release\better_sqlite3.pdb (Full PDB)
  test_extension.c
  win_delay_load_hook.cc
  Generating code
  All 2 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
  Finished generating code
  test_extension.vcxproj -> C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\better-sqlite3\build\Release\\test_extension.node
  test_extension.vcxproj -> C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\better-sqlite3\build\Release\test_extension.pdb (Full PDB)
  Copying C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\better-sqlite3\build\Release\/better_sqlite3.node to build\better_sqlite3.node
          1 file(s) copied.
  Copying C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\better-sqlite3\build\Release\/test_extension.node to build\test_extension.node
          1 file(s) copied.

><EMAIL_ADDRESS>install C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\integer
> node-gyp rebuild

C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\integer>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )
else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  integer.cpp
  win_delay_load_hook.cc
c:\users\cuntard\desktop\electron-application-master\node_modules\integer\src\integer.cpp(370): warning C4804: '-': unsafe use of type 'bool' in operation [C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\integer\build\integer.vcxproj]
     Creating library C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\integer\build\Release\integer.lib and object C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\integer\build\Release\integer.exp
  Generating code
  All 265 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
   Check the spelling of the name, or if a path was included, verify that the
path is correct and try again.
At line:1 char:1
+ ./node_modules/.bin/electron-rebuild
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (./node_modules/.bin/electron-rebuild:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

PS C:\Users\CuntarD\Desktop\Electron-Application-master> npm i electron-rebuild
npm WARN<EMAIL_ADDRESS>requires a peer of better-sqlite-pool@github:eslachance/better-sqlite-pool but none is installed. You must install peer dependencies yourself.
npm WARN<EMAIL_ADDRESS>No repository field.
npm WARN<EMAIL_ADDRESS>No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY<EMAIL_ADDRESS>(node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for<EMAIL_ADDRESS>wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+<EMAIL_ADDRESS>added 108 packages from 60 contributors and audited 2636 packages in 13.138s
found 0 vulnerabilities

PS C:\Users\CuntarD\Desktop\Electron-Application-master> ./node_modules/.bin/electron-rebuild
√ Rebuild Complete
PS C:\Users\CuntarD\Desktop\Electron-Application-master>

so delete your lock-file. run from the top installing everything in that order
down to what i did last

Here is the launch file if you need aswell. it should go under
.vscode/launch.json

{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Electron Main",
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron",
"program": "${workspaceFolder}/main.js"
}
]
}

The rebuild at the end (electron-rebuild) fails.

yes it failed 1st time because i didnt have it installed lol i just ran off your package.json you will see i install it then run again and look
PS C:\Users\CuntarD\Desktop\Electron-Application-master> ./node_modules/.bin/electron-rebuild
√ Rebuild Complete

PS C:\Users\CuntarD\Desktop\Electron-Application-master> npm i electron-rebuild
npm WARN<EMAIL_ADDRESS>requires a peer of better-sqlite-pool@github:eslachance/better-sqlite-pool but none is installed. You must install peer dependencies yourself.
npm WARN<EMAIL_ADDRESS>No repository field.
npm WARN<EMAIL_ADDRESS>No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY<EMAIL_ADDRESS>(node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for<EMAIL_ADDRESS>wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+<EMAIL_ADDRESS>added 108 packages from 60 contributors and audited 2636 packages in 13.138s
found 0 vulnerabilities

Huh, you already installed it and I'm sure I did too.

@Custardcs | pls <3

Im not sure what else i can do bro.. i tested everything with your project and you have my full log. so it does work.

Rips :(

In electron 4.0.3, I rebuild sucess and crash after load better_sqlite3.node'. I'm using serval node native modules like ffi`, 'searilport', only this will crash the process

Just to point that I'm also having problems with this.
Get this error:

NODE_MODULE_VERSION 67. This version of Node.js requires
NODE_MODULE_VERSION 64. Please try re-compiling or re-installing

I have electron-forge that rebuild everything after electron start BUT I also test directly with electron-rebuild. I also remove node_modules folder and installed everything again from scratch but still get the error.
Anyone was able to fix this already?
Thanks!

What happended to me 7 weeks ago (https://github.com/JoshuaWise/better-sqlite3/issues/126#issuecomment-461608144) is still happening an my MacBook. After loosing many hours trying to solve it I gave up, bought a Windows Notebook. On which this error has not (yet) occured.

Where it doesn't work for you even with the windows-build-tools, here is the fix :

Install Visual Studio Installer
Modify Visual Studio Build Tools 2017 (or install if you don't have)
Inside Visual C++ Build Tools, tick VC++ 2015.3 v14.00 (v140) toolset
Push the Install button (or Modify)
Retry running npm install better-sqlite3
Run node_modules/.bin/electron-rebuild -f -w better-sqlite3

And there you go, you can run your app.

I was struggling with this on my Windows machine for about an hour, until I realised that there are two electron-rebuild scripts in that folder.... The windows one ends in ".cmd", so the command you need to run is:
node_modules/.bin/electron-rebuild.cmd -f -w better-sqlite3
I've actually put this into a postinstall script in my package.json file, which now works for me.

Just to point that I'm also having problems with this.
Get this error:

NODE_MODULE_VERSION 67. This version of Node.js requires
NODE_MODULE_VERSION 64. Please try re-compiling or re-installing

I have electron-forge that rebuild everything after electron start BUT I also test directly with electron-rebuild. I also remove node_modules folder and installed everything again from scratch but still get the error.
Anyone was able to fix this already?
Thanks!

So when you have a version mismatch you don't always need to delete everything.. The easiest way to fix this is a simple rebuild. just make sure you have the npm package installed. 📦
you can try
'npm rebuild'
and/or
node_modules/.bin/electron-rebuild -f -w better-sqlite3
if you have more than one module that needs building like (bcypt) its best to use
node_modules/.bin/electron-rebuild.
if you have to then I seem to find doing it like this seems to work always.
https://github.com/JoshuaWise/better-sqlite3/issues/126#issuecomment-466570740

Where it doesn't work for you even with the windows-build-tools, here is the fix :

Install Visual Studio Installer
Modify Visual Studio Build Tools 2017 (or install if you don't have)
Inside Visual C++ Build Tools, tick VC++ 2015.3 v14.00 (v140) toolset
Push the Install button (or Modify)
Retry running npm install better-sqlite3
Run node_modules/.bin/electron-rebuild -f -w better-sqlite3

And there you go, you can run your app.

I was struggling with this on my Windows machine for about an hour, until I realised that there are two electron-rebuild scripts in that folder.... The windows one ends in ".cmd", so the command you need to run is:
node_modules/.bin/electron-rebuild.cmd -f -w better-sqlite3
I've actually put this into a postinstall script in my package.json file, which now works for me.

only problem with that as mac and linux not being able to use it. thats why Its not in the config. for us. but glad its working for you!

I have successfully run better-sqlite3 with my electron app. Just one more question is what is the best approach to query database from renderer process, by IPC calls to main process? I learned from James's post @jlongster that it's not ideal to block/overuse main process. Just wanna know if there is a optimal solution for this. Thanks!

@giddens9527 If there was no other way to do that without IPC call to main process, then you're good to go. I don't think there any other way

@mandaputtra Cool, thanks! Just worrying about the performance issues since blocking main process is quite scary.

Yes it is, :smile: I use IPC call too because I don't find any other way around (but it is great I don't find any issues) if you find out the another way around I would love to hear.

@mandaputtra I was reading hyper's blog mentioning IPC issues they had and what they did is batching IPC calls. I would probably doing this if any performance problem encountered.

In electron 4.0.3, I rebuild sucess and crash after load better_sqlite3.node.
I'm using serval node native modules like ffi, 'serialport', only this will crash the process
only crash in webpack, using process.dlopen, but run well withount webpack.

I think this might have something to do with https://github.com/JoshuaWise/better-sqlite3/issues/223#issuecomment-525266963

Is it ok to use same connection between browser and renderer process in Electron? Is it ok to open connection in one thread, insert from both threads and in the end close the connection from one of the threads?

I was getting the following error when running on Electron
FATAL ERROR: v8::ToLocalChecked Empty MaybeLocal.
 1: 00007FF62D2260B2 node::EmitAsyncDestroy+11834322
 2: 00007FF62C6B46B6 node::Abort+22
 3: 00007FF62C6B4C93 node::Abort+1523
 4: 00007FF62A22ED44 v8::V8::ToLocalEmpty+52
 5: 00007FFFE83E9CFC Require+252 [<redacted>\node_modules\.registry.npmjs.org\better-sqlite3\5.4.3\node_modules\better-sqlite3\build\src\util\macros.lzz]:L124
 6: 00007FFFE83DB3F3 RegisterModule+115 [<redacted>\node_modules\.registry.npmjs.org\better-sqlite3\5.4.3\node_modules\better-sqlite3\build\src\better_sqlite3.lzz]:L36

I tried electron-rebuild -f -w better-sqlite3,integer but it didn't work.
So I went to L36 of better_sqlite3.lzz and confirmed that the problem was indeed the integer npm module. This is when I remembered I was using pnpm, and that it has stricter dependencies. If you use pnpm, you must also run pnpm install --save integer, otherwise the require will fail.
After properly installing the integer module, I re-ran electron-rebuild and everything worked.

in case anyone using webpack for their electron app, there are couple things should be noted:

webpack bundles all the js file into one place, with default config, if you require('better-sqlite3') somewhere, it will also resolve it and all the better-sqlite3 source js code will be bundled. That will break the original file structure so when native code relies on js code thru relative path, it will crash.
it runs well without webpack cus none of above happens, either in development or when you package your app (it will bundle all the node_modules and source code so your app might ends up with huge size). Better-sqlite3 file structure remains the same so everything is fine.
if you want both benefits(small app size and runs better-sqlite3), the webpack config should be adjusted. firstly mark better-sqlite3 as external dependency so webpack won't resolve it, your code remains require('better-sqlite3') in the output and with no better-sqlite3 code being bundled:

// webpack config
{
  // ...
  externals: {
    'better-sqlite3': 'commonjs better-sqlite3',
  },
}

then use copy-webpack-plugin to copy the better-sqlite3 to your webpack output, to keep your app size minimum, you can only copy those code you need:
const CopyPlugin = require('copy-webpack-plugin');

// webpack config
{
  // ...
  plugins: [
    new CopyPlugin([
      {
        from: 'root/node_modules/better-sqlite3/',
        to: 'output/node_modules/better-sqlite3/', // still under node_modules directory so it could find this module
        ignore: [...] //
      },
    ]),
  ]
}

Serve crashing with vue-cli-plugin-electron-builder : yarn electron:serve
 ERROR  Failed to compile with 2 errors                                                                                11:59:10 AM

 error  in ./node_modules/integer/build/integer.node

Module parse failed: Unexpected character '' (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
(Source code omitted for this binary file)

 @ ./node_modules/integer/lib/index.js 2:33-65
 @ ./node_modules/better-sqlite3/lib/index.js
 @ ./src/utils/db/db.js
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://<IP_ADDRESS>:8080/sockjs-node (webpack)/hot/dev-server.js ./src/main.js

 error  in ./node_modules/better-sqlite3/build/better_sqlite3.node

Module parse failed: Unexpected character '' (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
(Source code omitted for this binary file)

 @ ./node_modules/better-sqlite3/lib/database.js 5:20-59
 @ ./node_modules/better-sqlite3/lib/index.js
 @ ./src/utils/db/db.js
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://<IP_ADDRESS>:8080/sockjs-node (webpack)/hot/dev-server.js ./src/main.js

electron6.0中压根用不了

If anyone else is trying to make this all work with

Electron 7.x
Angular 8.x
better-sqlite3 5.4.3

Here are the steps I took to get it to work from the Electron renderer process:

In my existing Angular/Electron project, npm i better-sqlite3 --save
Rebuild the binaries.  I used Electron-builder 21.2.0, although electron-rebuild 1.8.8 also worked.  See previous comments on this issue for info or simply search on electron-builder or electron-rebuild
In my angular.webpack.js file, just above the existing return config line, I added the following:

config["externals"] = {};
config.externals["better-sqlite3"] = "'better-sqlite3'";  <-- note the double-quotes then single-quotes wrapping the package name.  I sure wish the package was named better(no dash), but this works...

In my app.component.ts file I added the following sample code:

const db = window['require']('better-sqlite3')('mytest.db', { verbose: console.log });
const statement = `CREATE TABLE COMPANY(ID INT PRIMARY KEY NOT NULL,NAME TEXT NOT NULL,AGE INT NOT NULL,ADDRESS CHAR(50));`;
const tbl = db.prepare(statement);
tbl.run();

console.log('successful: ', db);

Compile and run the project
Check the console for the comment and the db object
Check the root of your project, there will be a file called mytest.db
Open that in something like SQLiteSpy and you'll see the company table.  No data in it, but that's just a matter of running some insert statements

From this POC, you can adapt as necessary for your needs.
HTH,
D

Hi,
I'm using electron-builder along with electron-react-boilerplate to build my app.

Version: version=20.34.0

Target: macOS

So, my project uses better-sqlite3.  And electron-builder supports this – great!  But one thing I need in my project is to spawn a child process that also uses better-sqlite3.  Unfortunately, the child process complains:

....was compiled against a different Node.js version using
NODE_MODULE_VERSION 64. This version of Node.js requires
NODE_MODULE_VERSION 67

To summarize:

better-sqlite3 is working great inside my main Electron app
I need a separate build (somehow) of better-sqlite3 that works with child processes

Any hints?

I have the same issue when trying to use better-sqlite3 in my Angular + Electron app without success:
https://stackoverflow.com/questions/60363484/using-better-sqlite3-in-an-angular-electron-app-module-parse-failed-unexpect
any help with it?

For anyone using electron-forge, I found a working solution by following the steps below:

Install better-sqlite3 as a dependency

$ npm install –save better-sqlite3

Install electron-rebuild as a dev dependency

$ npm install --save-dev electron-rebuild

Run the following command to build native modules

$ electron-rebuild -f -w better-sqlite3

Install @electron-forge/plugin-auto-unpack-natives as a dev dependency

$ npm i -D @electron-forge/plugin-auto-unpack-natives

Create forge.config.js at the root of the project to copy native modules to Electron Forge’s webpack output directory

module.exports = {
 plugins: [['@electron-forge/plugin-auto-unpack-natives']]
}

Now run Electron Forge to make it work

$ npm start

Hope it helps :)

Anybody having issues with Electron should try upgrading to v7.0.0. It fixes many things related to bundling native applications

Tried v8.2.5 with vue-cli-plugin-electron-builder,
Tested with simply
import sqlite3 from 'better-sqlite3'
sqlite3(`${__dirname}/test.db`)

No error on build, but on start up the program,

If I removed the two lines, no error occurs.

I'm experiencing a lot of issues with:

electron: 8.3.0,
better-sqlite3: ^7.0.1.
and using it in webworkers.

I've a lot of applications crashes and sometimes the database get corrupted as well.
The error is: database disk image is malformed.
I'm using some web workers so do background fetches and inserts, while some other are used for async queries (similar to what suggested here: https://github.com/JoshuaWise/better-sqlite3/blob/master/docs/threads.md but using webworker instead of thread workers).
Is anybody else having these kind of problems?
Is better-sqlite3 supposed to work normally in webworkers or i should just move the logic somewhere else?

@oltreseba I'm not even sure how it works at all in webworkers... should definitely be in your main thread or a thread worker.  Is it really too slow in your primary service thread?

@oltreseba I am pretty sure you shouldn't do any write operation in Web Workers, only read. For writes, you might only wrap in functions, observables, or even setTimeout.
Otherwise, heavy joins / query in Web Workers might be OK. I have also tried threads.js with observable-fns.

@tracker1 unfortunately i cannot find enough documentation about how webworkers work in electron compared with thread workers and also what is supposed to be done and what not. Also i cannot find any info about which problems I can have in running native modules on those. According to official documentation, webworkers can run modules, event with native code, as long as these modules are context aware and better-sqlite should be now. But really I can find enough information about this in general. Maybe there is some shared memory or other concurrency problems that webworkers may have, that I'm not aware of.
Actually webworkers seems to be slower than the main renderer thread, but it's in background,so the user won't notice.
@patarapolw Thank you for your tip. I will now try it with some flags about fullssync and if i'm not able to solve i will move the entire logic to the main renderer thread. Currently we started using workers because we are fetching data from several services a putting them in sql storage. There are sort of background sync and it's really convenient to have this running in background without blocking the main thread.

Hello mates,
I've been working with a reactjs electron thing and using the better-sqlite3 module. When I use the development mode it works pretty well but when I use electron-builder for a dist it just doesn't find the database file.

Thanks!
Error:

Hello mates,
I've been working with a reactjs electron thing and using the better-sqlite3 module. When I use the development mode it works pretty well but when I use electron-builder for a dist it just doesn't find the database file.

Thanks!
Error:

for the future someone who may have the same problem.
i solved, by putting the database in the userData. then it can access.

For those getting the
....was compiled against a different Node.js version using
NODE_MODULE_VERSION 72. This version of Node.js requires
NODE_MODULE_VERSION 80

Simply installing electron-rebuild and then running, on Windows:
.\node_modules\.bin\electron-rebuild.cmd
Resolved the error

Hi All,
I'm in the early stages of building an Electron App that uses better-sqlite3 as the database system.  The other node modules that I'm using are pure JS.
My question is about Apple's announcement that they will be using their own silicone and Universal 2.   Apple has posted that they are/will be providing pull requests to the main Electron project to make that system be able to build the fat Universal 2 binary (both the intel build and ARM build are in one package).
My question is about the  better-sqlite3 module in this environment.  It appears to me the module needs to build on the specified system.  So, it sure seems like there would need to be two separate builds of the module in a Universal 2 binary.  So my questions are:

Do the developers have an idea how this might work?
Those of us who are end users of the library, but we know we will need to support this in the future, is there any special considerations we need to think about when using better-sqlite3?

Thanks for all of the work the development team has done on this library.  I've only been programming with it for about a day and it feels like a great API where everything just makes sense.

It may be worth linking to the Electron documentation on native dependencies which explain a whole class of problems, notably why you'd need to use electron-rebuild and why you would need to run it when packaging / for each platform.

Hello there,
I want to add a trigger on a table that would notify an electron render process when columns are inserted/updated/deleted. I am thinking of adding a few database functions that would do that and call them in the trigger:
private _createNotifierTrigger = ({
    on,
    onTrigger,
    onTriggerArgs,
  }: {
    on: "update" | "insert" | "delete";
    onTrigger: (...params: any[]) => any;
    onTriggerArgs: any[];
  }) => {
    this.db
      .transaction(() => {
        const funcName = onTrigger.name || "a" + Math.random().toString().replace(".", "");
        this.db.function(funcName, onTrigger);

        this.db
          .prepare(
            `
            CREATE TRIGGER IF NOT EXISTS on_${on}_trigger
              AFTER ${on} ON users
            BEGIN
              SELECT ${funcName}(${onTriggerArgs.map(() => "?").join(",")});
            END
            `
          )
          .run(...onTriggerArgs);
      })
      .default();
  };

  createNotifierTriggers = (
    onTrigger: (...params: any[]) => any,
    ...onTriggerArgs: any[]
  ) => {
    this._createNotifierTrigger({ on: "insert", onTrigger, onTriggerArgs });
    this._createNotifierTrigger({ on: "update", onTrigger, onTriggerArgs });
    this._createNotifierTrigger({ on: "delete", onTrigger, onTriggerArgs });
  };

const onUsersChanged = () => {
  console.log("this should be logged")
  win?.webContents.send("users_changed");
}
usersService.createNotifierTriggers(onUsersChanged);

It does register the trigger, but it seems like it doesn't run it. Any help would be greatly appreciated.

I just wanted to call function from Electron app and here remoteModules.js is for these exports functions. The problem is, I got a mysterious error Uncaught Error: \\? on the Electron app developer console. And the error seems caused by require('sleep'); lines. Not only sleep module, I also tried require('better-sqlite3'); and I confirmed I get the same error, so I think I can assume this error caused when requiring a npm installed module. So, what is this, and how can I bypass this bug to import modules successfully? Thanks.
index.html:

const remoteModules = require('electron').remote.require('./remoteModules')
console.log("remoteModules.tmp:", remoteModules.tmp(3))

.. more code

remoteModules.js:

var fs = require('fs');
var path = require('path');

// # I tried all of these and got the same or similar error
// var sleep = require('sleep');
// var sleep = require(path.join(__dirname, 'sleep'));
// var sleep = require(path.join(__dirname, 'node_modules\\sleep\\build\\Release\\node_sleep.node'));
// var sleep = require(path.join(__dirname, 'C:/pg/electron/note_system_ui/node_modules/sleep/build/Release/node_sleep.node'));
// var sleep = require(path.join(__dirname, 'C:\\pg\\electron\\note_system_ui\\node_modules\\sleep\\build\\Release\\node_sleep.node'));
// var sleep = require( 'C:\\pg\\electron\\note_system_ui\\node_modules\\sleep\\build\\Release\\node_sleep.node' );
// var sleep = require( 'C:/pg/electron/note_system_ui/node_modules/sleep/build/Release/node_sleep.node' );

.. more code

full error:
Uncaught Error: \\?\C:\pg\electron\note_system_ui\node_modules\sleep\build\Release\node_sleep.node is not a valid Win32 application.

versions:
"dependencies": {
    "better-sqlite3": "^7.1.2",
    "electron": "^11.1.1",
    "sleep": "^6.3.0"
  },

I just wanted to call function from Electron app and here remoteModules.js is for these exports functions. The problem is, I got a mysterious error Uncaught Error: \\? on the Electron app developer console. And the error seems caused by require('sleep'); lines. Not only sleep module, I also tried require('better-sqlite3'); and I confirmed I get the same error, so I think I can assume this error caused when requiring a npm installed module. So, what is this, and how can I bypass this bug to import modules successfully? Thanks.
index.html:

const remoteModules = require('electron').remote.require('./remoteModules')
console.log("remoteModules.tmp:", remoteModules.tmp(3))

.. more code

remoteModules.js:

var fs = require('fs');
var path = require('path');

// # I tried all of these and got the same or similar error
// var sleep = require('sleep');
// var sleep = require(path.join(__dirname, 'sleep'));
// var sleep = require(path.join(__dirname, 'node_modules\\sleep\\build\\Release\\node_sleep.node'));
// var sleep = require(path.join(__dirname, 'C:/pg/electron/note_system_ui/node_modules/sleep/build/Release/node_sleep.node'));
// var sleep = require(path.join(__dirname, 'C:\\pg\\electron\\note_system_ui\\node_modules\\sleep\\build\\Release\\node_sleep.node'));
// var sleep = require( 'C:\\pg\\electron\\note_system_ui\\node_modules\\sleep\\build\\Release\\node_sleep.node' );
// var sleep = require( 'C:/pg/electron/note_system_ui/node_modules/sleep/build/Release/node_sleep.node' );

.. more code

full error:
Uncaught Error: \\?\C:\pg\electron\note_system_ui\node_modules\sleep\build\Release\node_sleep.node is not a valid Win32 application.

versions:
"dependencies": {
    "better-sqlite3": "^7.1.2",
    "electron": "^11.1.1",
    "sleep": "^6.3.0"
  },

OH MY GOD I CAN
Sorry first time i know how to help someone in a forum this is a pretty special moment for me.
So when you build electron it does not respect the relative path. I have no idea why nor how to solve it.
BUT
you can in fact reallocate your database to a accessible  for the build. That's what i did for my app to workout. Put you db in the AppData path. Im not at home right now so i don't have the code i used, when i arrive home i'll send another comment on this giving you a better explanation.

OH MY GOD I CAN
Sorry first time i know how to help someone in a forum this is a pretty special moment for me.
So when you build electron it does not respect the relative path. I have no idea why nor how to solve it.
BUT
you can in fact reallocate your database to a accessible  for the build. That's what i did for my app to workout. Put you db in the AppData path. Im not at home right now so i don't have the code i used, when i arrive home i'll send another comment on this giving you a better explanation.

ok did not arrived home tho i found my app's code here on github (im using a mobile)

const userData = app.getPath('userData');
let databasePath = path.join(userData, 'data.sqlite');;

you import the app from electron.
my app repo
look at public/electron.js file

ok did not arrived home tho i found my app's code here on github (im using a mobile)

const userData = app.getPath('userData');
let databasePath = path.join(userData, 'data.sqlite');;

you import the app from electron.
my app repo
look at public/electron.js file

please text me on twitter, or mail me the news
twitter: @dkcamargox
mail<EMAIL_ADDRESS>

please text me on twitter, or mail me the news
twitter: @dkcamargox
mail<EMAIL_ADDRESS>

@dkcamargox Thank you for your advice!
It is working now! Now I am facing the issue that the build folder of react seems not to be bundled correctly into the app.

@dkcamargox Thank you for your advice!
It is working now! Now I am facing the issue that the build folder of react seems not to be bundled correctly into the app.

what i mean is, react does not run for itself the browser do not run it alone, node has to do it y'know.
whatvi did was to create a little server with expressjs to run the react build, and then put electron to display the server return.

what i mean is, react does not run for itself the browser do not run it alone, node has to do it y'know.
whatvi did was to create a little server with expressjs to run the react build, and then put electron to display the server return.

How far is Windows (crossplatform build from Linux) supported? Cannot see Windows in Releases Page...
Building for Electron 11 succeed only for Linux and macOS, but not for Windows.

How far is Windows (crossplatform build from Linux) supported? Cannot see Windows in Releases Page...
Building for Electron 11 succeed only for Linux and macOS, but not for Windows.

@patarapolw  I could build for windows using better-sqlite 7.1.1

@patarapolw  I could build for windows using better-sqlite 7.1.1

@patarapolw I could build for windows using better-sqlite 7.1.1
I think i had to add into "build" (used electron-builder)
    "extends": null,

It passes validation, but it does not build.
  • rebuilding native dependencies<EMAIL_ADDRESS><EMAIL_ADDRESS>platform=win32 arch=x64
  • install prebuilt binary  name=better-sqlite3 version=7.1.1 platform=win32 arch=x64
  ⨯ cannot build native dependency  reason=prebuild-install failed with error and build from sources not possible because platform or arch not compatible
                                    cause=exit status 1
                                    errorOut=prebuild-install info begin Prebuild-install version 5.3.6
    prebuild-install info looking for cached prebuild @ /home/polv/.npm/_prebuilds/b53dd6-better-sqlite3-v7.1.1-electron-v85-win32-x64.tar.gz
    prebuild-install http request GET https://github.com/JoshuaWise/better-sqlite3/releases/download/v7.1.1/better-sqlite3-v7.1.1-electron-v85-win32-x64.tar.gz
    prebuild-install http 404 https://github.com/JoshuaWise/better-sqlite3/releases/download/v7.1.1/better-sqlite3-v7.1.1-electron-v85-win32-x64.tar.gz
    prebuild-install WARN install No prebuilt binaries found (target=11.1.1 runtime=electron arch=x64 libc= platform=win32)

                                    command=/home/polv/.nvm/versions/node/v12.20.0/bin/node /home/polv/projects/zhquiz/submodules/e-zhquiz/node_modules/prebuild-install/bin.js --platform=win32 --arch=x64 --target=11.1.1 --runtime=electron --verbose --force
                                    workingDir=/home/polv/projects/zhquiz/submodules/e-zhquiz/node_modules/better-sqlite3
error Command failed with exit code 1.

@patarapolw I could build for windows using better-sqlite 7.1.1
I think i had to add into "build" (used electron-builder)
    "extends": null,

It passes validation, but it does not build.
  • rebuilding native dependencies<EMAIL_ADDRESS><EMAIL_ADDRESS>platform=win32 arch=x64
  • install prebuilt binary  name=better-sqlite3 version=7.1.1 platform=win32 arch=x64
  ⨯ cannot build native dependency  reason=prebuild-install failed with error and build from sources not possible because platform or arch not compatible
                                    cause=exit status 1
                                    errorOut=prebuild-install info begin Prebuild-install version 5.3.6
    prebuild-install info looking for cached prebuild @ /home/polv/.npm/_prebuilds/b53dd6-better-sqlite3-v7.1.1-electron-v85-win32-x64.tar.gz
    prebuild-install http request GET https://github.com/JoshuaWise/better-sqlite3/releases/download/v7.1.1/better-sqlite3-v7.1.1-electron-v85-win32-x64.tar.gz
    prebuild-install http 404 https://github.com/JoshuaWise/better-sqlite3/releases/download/v7.1.1/better-sqlite3-v7.1.1-electron-v85-win32-x64.tar.gz
    prebuild-install WARN install No prebuilt binaries found (target=11.1.1 runtime=electron arch=x64 libc= platform=win32)

                                    command=/home/polv/.nvm/versions/node/v12.20.0/bin/node /home/polv/projects/zhquiz/submodules/e-zhquiz/node_modules/prebuild-install/bin.js --platform=win32 --arch=x64 --target=11.1.1 --runtime=electron --verbose --force
                                    workingDir=/home/polv/projects/zhquiz/submodules/e-zhquiz/node_modules/better-sqlite3
error Command failed with exit code 1.

After I build my app today two times I now encounter the same error as @patarapolw
prebuild-install http 404 https://github.com/JoshuaWise/better-sqlite3/releases/download/v7.1.1/better-sqlite3-v7.1.1-electron-v82-win32-x64.tar.gz     prebuild-install WARN install No prebuilt binaries found (target=10.1.5 runtime=electron arch=x64 libc= platform=win32)

After I build my app today two times I now encounter the same error as @patarapolw
prebuild-install http 404 https://github.com/JoshuaWise/better-sqlite3/releases/download/v7.1.1/better-sqlite3-v7.1.1-electron-v82-win32-x64.tar.gz     prebuild-install WARN install No prebuilt binaries found (target=10.1.5 runtime=electron arch=x64 libc= platform=win32)

I'm using Electron 12.0.0-beta.18 (Node.js LTS 14.15, NODE_MODULE_VERSION 87). On Windows, better-sqlite3 7.1.2 is rebuilt with electron-rebuild and it works like expected. But on Linux electron-rebuilt does not trigger the compilation step, so the electron app fails to start with the usual message for NODE_MODULE_VERSION mismatch errors:
Error: The module '/home/renkei/Development/MyApp/node_modules/better-sqlite3/build/Release/better_sqlite3.node'
was compiled against a different Node.js version using NODE_MODULE_VERSION 85.
This version of Node.js requires NODE_MODULE_VERSION 87.
Please try re-compiling or re-installing the module (for instance, using `npm rebuild` or `npm install`).

My electron-rebuild output on Linux:
export DEBUG=*
node_modules/.bin/electron-rebuild

Searching dependency tree
electron-rebuild skipping: better-sqlite3 as it is already built +52ms
✔ Rebuild Complete

If I force the rebuild with -f then I get
Searching dependency tree
Building module: better-sqlite3, Completed: 0
electron-rebuild assuming is prebuild powered: better-sqlite3 +0ms
electron-rebuild triggering prebuild download step: better-sqlite3 +0ms
Building module: better-sqlite3, Completed: 0
electron-rebuild built: better-sqlite3 +106ms
✔ Rebuild Complete

I've found prebuilt binary packages for electron in the release area of this repository. Unfortunately, only up to NODE_MODULE_VERSION 85 at the moment. Is it possible to add a binary compatible to NM87 as well?  Or can I do something so that electron-rebuild starts the compile step not only on Windows but also on Linux?
Thanks in advance.

I'm using Electron 12.0.0-beta.18 (Node.js LTS 14.15, NODE_MODULE_VERSION 87). On Windows, better-sqlite3 7.1.2 is rebuilt with electron-rebuild and it works like expected. But on Linux electron-rebuilt does not trigger the compilation step, so the electron app fails to start with the usual message for NODE_MODULE_VERSION mismatch errors:
Error: The module '/home/renkei/Development/MyApp/node_modules/better-sqlite3/build/Release/better_sqlite3.node'
was compiled against a different Node.js version using NODE_MODULE_VERSION 85.
This version of Node.js requires NODE_MODULE_VERSION 87.
Please try re-compiling or re-installing the module (for instance, using `npm rebuild` or `npm install`).

My electron-rebuild output on Linux:
export DEBUG=*
node_modules/.bin/electron-rebuild

Searching dependency tree
electron-rebuild skipping: better-sqlite3 as it is already built +52ms
✔ Rebuild Complete

If I force the rebuild with -f then I get
Searching dependency tree
Building module: better-sqlite3, Completed: 0
electron-rebuild assuming is prebuild powered: better-sqlite3 +0ms
electron-rebuild triggering prebuild download step: better-sqlite3 +0ms
Building module: better-sqlite3, Completed: 0
electron-rebuild built: better-sqlite3 +106ms
✔ Rebuild Complete

I've found prebuilt binary packages for electron in the release area of this repository. Unfortunately, only up to NODE_MODULE_VERSION 85 at the moment. Is it possible to add a binary compatible to NM87 as well?  Or can I do something so that electron-rebuild starts the compile step not only on Windows but also on Linux?
Thanks in advance.

@renkei  Try to downgrade to the last stable electron version

@renkei  Try to downgrade to the last stable electron version

Is there no other way? I'm using new ES2020 features like the optional chaining operator and the nullish coalescing operator a lot but this requires Node 14 LTS, current electron stable is still at Node 12 LTS.
I assume that in two months, when Electron 12 is released, a NM87 compatible prebuilt binary will be uploaded here anyway. In the meanwhile it would be fully sufficient to me to recompile better-sqlite3 with electron-rebuild, like I do on Windows. Can someone give me a hint, why the recompilation is not running on Linux? Or the other way around: how are the prebuilt linux binaries for electron created which are available here in the release area?

Is there no other way? I'm using new ES2020 features like the optional chaining operator and the nullish coalescing operator a lot but this requires Node 14 LTS, current electron stable is still at Node 12 LTS.
I assume that in two months, when Electron 12 is released, a NM87 compatible prebuilt binary will be uploaded here anyway. In the meanwhile it would be fully sufficient to me to recompile better-sqlite3 with electron-rebuild, like I do on Windows. Can someone give me a hint, why the recompilation is not running on Linux? Or the other way around: how are the prebuilt linux binaries for electron created which are available here in the release area?

I've solved this with a postinstall script in package.json that runs electron-rebuild on Windows and a self-made shell script on Linux that executes npm install better-sqlite3 again, but this time npm is re-configured to build directly for electron, like suggested by the electron documentation as an alternative to electron-rebuild, works perfectly for me.
#!/bin/bash

# Electron's version.
export npm_config_target=$1

# 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

# Install all dependencies, and store cache to ~/.electron-gyp.
HOME=~/.electron-gyp npm install better-sqlite3

I've solved this with a postinstall script in package.json that runs electron-rebuild on Windows and a self-made shell script on Linux that executes npm install better-sqlite3 again, but this time npm is re-configured to build directly for electron, like suggested by the electron documentation as an alternative to electron-rebuild, works perfectly for me.
#!/bin/bash

# Electron's version.
export npm_config_target=$1

# 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

# Install all dependencies, and store cache to ~/.electron-gyp.
HOME=~/.electron-gyp npm install better-sqlite3

Dear peoples,
I was wondering if anyone is building better-sqlite3 for Electron successfully on Windows with MSVS 2015. My npm rebuild and direct node-gyp rebuild for this package work just fine, and on the other hand, I can get other packages to build using Electron headers both through electron-rebuild and direct node-gyp, but even after many days of trying, I just can't figure out why I can't get this to build. It seems to work with MSVS 2017, but it would make my life so much easier, if I could get it to work on 2015 as well as the build environment I get to use does not have it available. I have installed my build environment on this clean Windows 10 virtual machine using npm install -g --vs2015 windows-build-tools. In addition, I have only installed Node 14.
The problem is like this:
I run  node-gyp.cmd rebuild --dist-url=https://electronjs.org/headers --target=11.2.1 --runtime=electron and I get result like:
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  extract_sqlite3
  sqlite3.c
  win_delay_load_hook.cc
  sqlite3.vcxproj -> Z:\buildtest\node_modules\better-sqlite3\build\Release\\sqlite3.lib
  better_sqlite3.cpp
  win_delay_load_hook.cc
c:\users\mr spock\appdata\local\node-gyp\cache\11.2.1\include\node\cppgc/common.h(17): error C2144: syntax error: 'int' should be preceded by '}' (compiling
 source file ..\src\better_sqlite3.cpp) [Z:\buildtest\node_modules\better-sqlite3\build\better_sqlite3.vcxproj]
c:\users\mr spock\appdata\local\node-gyp\cache\11.2.1\include\node\cppgc/common.h(17): error C2144: syntax error: 'int' should be preceded by ';' (compiling
 source file ..\src\better_sqlite3.cpp) [Z:\buildtest\node_modules\better-sqlite3\build\better_sqlite3.vcxproj]
c:\users\mr spock\appdata\local\node-gyp\cache\11.2.1\include\node\cppgc/common.h(18): error C2065: 'kMayContainHeapPointers': undeclared identifier (compil
ing source file ..\src\better_sqlite3.cpp) [Z:\buildtest\node_modules\better-sqlite3\build\better_sqlite3.vcxproj]
...

Here is the full build log with --verbose for node-gyp: https://gist.github.com/b088cdc3e3aac66278c867bd4ec4f128
In addition to  this direct node-gyp invocation, I have it through electron-rebuild (which does this anyway) and also through npm rebuild by first setting the npm_config_* variables to point to Electron headers: every way result is this same error.
I have also tried comparing the gyp configuration to other packages that I can get to build, but I haven't had any success yet.
I would appreciate any ideas anyone might have.

I strongly regret migrating from Java to Node (Electron) because of this right now. Impossible to build for Electron 11.2.3 on windows. Why does this have to be so difficult? Wasted 2 days for this already with 1000s of browser tabs open reading every issue, guide regarding this.

Java is pretty much a sure hit for a desktop app targeting multiple platforms; but you will have to bundle JVM along with the app; and there is no as convenient way to do that cross-platform, cross-compile as Electron Builder.
Electron Builder with install-app-deps is pretty much perfect, if not for a certain C++ binded library.

@patarapolw you're exactly right. install-app-deps failed for me before I wrote that and just a few minutes later, It randomly worked. It's the only one that worked. I don't know what worked. It's either a reboot or or npm config set msvs_version 2017. It's so weird and unreliable. 😕

@m4heshd https://github.com/excelsior-oss
Nice, but some deps might have to be native; or in C or C++, to cooperate well with native OS...

@patarapolw That's the one and yes. As you said, the SQLite driver was native. Had precompiled natives for all platforms packed in with execution switching at runtime. But the stability was undoubtedly good.
Been with C++ for a long time and dumped it to move to Java. Hardly felt the difference. I stuck to Java for more than 8 years. But always missed a good UI framework. FX was okay but not great. I've been bouncing between node and Java for a few years now. I really miss the reliability of Java whenever I'm on node. Gonna move back to C++ accompanied with node. I think that's a good decision at this point.

Hi, would really appreciate some help. I am originally a C++/C# programmer. did some typescript things, but I am far from being a pro. I am building an Electron App (for personal project) on top of a Typescript node project that I did which uses better-sqlite3. I actually started with NWJS and got an error about the binding file not found, when I copied the entire directory with the binding file to where it was looking for it, it still didn't work. so I moved to electron which seems to have more support, worked a lot on getting it to compile etc, and boom - I am in the same situation - I get the same error about "Error: Could not locate the bindings file. Tried:" I don't see anyone mentioning it here so I wanted to know -

What am I missing
How is the selection of which folders to look for the binding is done
What should I do here?

Thanks!

@RonGros What tool are you using to build better-sqlite3? And what platform?

Right :) I forgot to mention. so to be honest, I just tried (what I haven't tried with electron) just copying the better-sqlite3 build folder to another folder that I know the binding looks for it, and it seems to be working. I am now getting the "could not open file because the directory does not exit" which I saw other people talking about. so I am already in much better shape.
I guess what I Am left with is - how does the binding decide where to look for the ".node" file?
as for the questions - I am building win64, and I used electron-rebuild to build the sqlite as proposed in some different forums.  (node_modules/.bin/electron-rebuild -f -w better-sqlite3)

First, don't use electron-rebuild. Use electron-builder instead.
Second, make sure you're using msvs_version=2017 or 2019 and make sure to have the corresponding build tools installed. I'm using 2017.
When using electron-builder add the following configs and build for production once. This makes sure that it won't download prebuilt binaries. Remember this doesn't work for install-app-deps

npmRebuild: true,
buildDependenciesFromSource: true

Then go check for the bindings in following location.

The compiled file's location should be better-sqlite3\build\Release\better_sqlite3.node

Thanks! can you explain how is electron-builder better? I am really lost in these things. not a FE guy :)

Because electron-builder works?? 😋 It's true though. It's better maintained, big community and easier to automate everything with it since it's an all-in-one suite for building and packaging. electron-rebuild never worked for me. It also doesn't seem to respect the npmrc config.

I try to use better-sqlite3 in Electron on a Raspberry Pi 3. It compiles and rebuild 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. 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.

@m4heshd I forgot to precise that it works on my x64 machine. I simply don't set the -a flag. 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.

@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.

Thank you for you 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 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<EMAIL_ADDRESS>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<EMAIL_ADDRESS>"Please update to latest v2.3 or v2.2"
npm WARN deprecated<EMAIL_ADDRESS>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<EMAIL_ADDRESS>request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated<EMAIL_ADDRESS>this library is no longer supported

><EMAIL_ADDRESS>install /home/Documents/poky/build/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/npmpkg
> prebuild-install || npm run build-release

><EMAIL_ADDRESS>build-release /home/Documents/poky/build/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/better-sqlite3/7.1.1-r0/npmpkg
> node-gyp rebuild --release

make: Entering directory '/home/Documents/poky/build/tmp/work/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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/cortexa9t2hf-neon-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'