WiseLibs/better-sqlite3

Help me use Electron!

Opened this issue ยท 181 comments

Electron Help Thread

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

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

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.

(Edit by @mceachen: electron-rebuild was renamed to @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)

@jlongster That's great, the help is much appreciated

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 read me

/////////////////////////////////////////////
SETUP AND INSTALL MODULES
/////////////////////////////////////////////
better-sqlite3 instructios

npm install -g windows-build-tools(might need to install python and add the dir to the env file in windows)

if that doesnt work install

python 2.7 (not 3)

then below to add to path.
https://www.pythoncentral.io/add-python-to-path-python-is-not-recognized-as-an-internal-or-external-command/

(windows 7 install .net 4.5.1)

go (C:\Users%USERNAME%.windows-build-tools)
run

BuildTools_Full.exe

open BuildTools and click modify

Check VC++ 2015.3 v14.00(v140) toolset for desktop

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

if you have more than one module that needs building like (bcypt) its best to use

node_modules/.bin/electron-rebuild.

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.

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

> electron@4.0.5 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 bank-account@1.0.0 No description
npm WARN bank-account@1.0.0 No repository field.
npm WARN bank-account@1.0.0 No license field.

+ electron@4.0.5
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 bank-account@1.0.0 No description
npm WARN bank-account@1.0.0 No repository field.
npm WARN bank-account@1.0.0 No license field.

+ electron-rebuild@1.8.4
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

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

> better-sqlite3@5.4.0 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 bank-account@1.0.0 No description
npm WARN bank-account@1.0.0 No repository field.
npm WARN bank-account@1.0.0 No license field.

+ better-sqlite3@5.4.0
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 bank-account@1.0.0 No description
npm WARN bank-account@1.0.0 No repository field.
npm WARN bank-account@1.0.0 No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ electron-reload@1.4.0
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 enmap@4.8.1 requires a peer of better-sqlite-pool@github:eslachance/better-sqlite-pool but none is installed. You must install peer dependencies yourself.
npm WARN bank-account@1.0.0 No description
npm WARN bank-account@1.0.0 No repository field.
npm WARN bank-account@1.0.0 No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ enmap@4.8.1
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 enmap@4.8.1 requires a peer of better-sqlite-pool@github:eslachance/better-sqlite-pool but none is installed. You must install peer dependencies yourself.
npm WARN bank-account@1.0.0 No description
npm WARN bank-account@1.0.0 No repository field.
npm WARN bank-account@1.0.0 No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ moment@2.24.0
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 done testing :P

I dont have access to the repository

Hmm, I sent an invitation to you. I believe it should be accessible through your email.

so its working

image

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

> electron@4.0.5 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 bank-account@1.0.0 No repository field.
npm WARN bank-account@1.0.0 No license field.

+ electron@4.0.5
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

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

> better-sqlite3@5.4.0 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 bank-account@1.0.0 No repository field.
npm WARN bank-account@1.0.0 No license field.

+ better-sqlite-pool@0.2.0
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 bank-account@1.0.0 No repository field.
npm WARN bank-account@1.0.0 No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ electron-reload@1.4.0
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 enmap@4.8.1 requires a peer of better-sqlite-pool@github:eslachance/better-sqlite-pool but none is installed. You must install peer dependencies yourself.
npm WARN bank-account@1.0.0 No repository field.
npm WARN bank-account@1.0.0 No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ enmap@4.8.1
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 enmap@4.8.1 requires a peer of better-sqlite-pool@github:eslachance/better-sqlite-pool but none is installed. You must install peer dependencies yourself.
npm WARN bank-account@1.0.0 No repository field.
npm WARN bank-account@1.0.0 No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ moment@2.24.0
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

> better-sqlite3@5.4.0 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.

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

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

better-sqlite-pool@0.2.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\better-sqlite-pool
@types/better-sqlite3@5.2.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\@types\better-sqlite3
@types/integer@1.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\@types\integer
better-sqlite3@5.4.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\better-sqlite3
integer@2.1.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\integer
tar@4.4.8 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\tar
chownr@1.1.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\chownr
fs-minipass@1.2.5 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\fs-minipass
minipass@2.3.5 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\minipass
safe-buffer@5.1.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\safe-buffer
yallist@3.0.3 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\yallist
minizlib@1.2.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\minizlib
mkdirp@0.5.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\mkdirp
minimist@0.0.8 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\mkdirp\node_modules\minimist
electron-reload@1.4.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\electron-reload
chokidar@2.1.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\chokidar
anymatch@2.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\anymatch
micromatch@3.1.10 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\micromatch
arr-diff@4.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\arr-diff
array-unique@0.3.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\array-unique
braces@2.3.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\braces
arr-flatten@1.1.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\arr-flatten
extend-shallow@2.0.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\braces\node_modules\extend-shallow
is-extendable@0.1.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\is-extendable
fill-range@4.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\fill-range
extend-shallow@2.0.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\fill-range\node_modules\extend-shallow
is-number@3.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\is-number
kind-of@3.2.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\is-number\node_modules\kind-of
is-buffer@1.1.6 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\is-buffer
repeat-string@1.6.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\repeat-string
to-regex-range@2.1.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\to-regex-range
isobject@3.0.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\isobject
repeat-element@1.1.3 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\repeat-element
snapdragon@0.8.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\snapdragon
base@0.11.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\base
cache-base@1.0.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\cache-base
collection-visit@1.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\collection-visit
map-visit@1.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\map-visit
object-visit@1.0.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\object-visit
component-emitter@1.2.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\component-emitter
get-value@2.0.6 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\get-value
has-value@1.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\has-value
has-values@1.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\has-values
kind-of@4.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\has-values\node_modules\kind-of
set-value@2.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\set-value
extend-shallow@2.0.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\set-value\node_modules\extend-shallow
is-plain-object@2.0.4 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\is-plain-object
split-string@3.1.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\split-string
extend-shallow@3.0.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\extend-shallow
assign-symbols@1.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\assign-symbols
is-extendable@1.0.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\extend-shallow\node_modules\is-extendable
to-object-path@0.3.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\to-object-path
kind-of@3.2.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\to-object-path\node_modules\kind-of
union-value@1.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\union-value
arr-union@3.1.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\arr-union
set-value@0.4.3 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\union-value\node_modules\set-value
extend-shallow@2.0.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\union-value\node_modules\extend-shallow
unset-value@1.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\unset-value
has-value@0.3.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\unset-value\node_modules\has-value
has-values@0.1.4 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\unset-value\node_modules\has-values
isobject@2.1.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\unset-value\node_modules\has-value\node_modules\isobject
isarray@1.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\unset-value\node_modules\isarray
class-utils@0.3.6 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\class-utils
define-property@0.2.5 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\class-utils\node_modules\define-property
is-descriptor@0.1.6 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\is-descriptor
is-accessor-descriptor@0.1.6 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\is-accessor-descriptor
kind-of@3.2.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\is-accessor-descriptor\node_modules\kind-of
is-data-descriptor@0.1.4 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\is-data-descriptor
kind-of@3.2.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\is-data-descriptor\node_modules\kind-of
kind-of@5.1.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\is-descriptor\node_modules\kind-of
static-extend@0.1.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\static-extend
define-property@0.2.5 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\static-extend\node_modules\define-property
object-copy@0.1.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\object-copy
copy-descriptor@0.1.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\copy-descriptor
define-property@0.2.5 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\object-copy\node_modules\define-property
kind-of@3.2.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\object-copy\node_modules\kind-of
define-property@1.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\base\node_modules\define-property
is-descriptor@1.0.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\base\node_modules\is-descriptor
is-accessor-descriptor@1.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\base\node_modules\is-accessor-descriptor
kind-of@6.0.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\kind-of
is-data-descriptor@1.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\base\node_modules\is-data-descriptor
mixin-deep@1.3.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\mixin-deep
for-in@1.0.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\for-in
is-extendable@1.0.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\mixin-deep\node_modules\is-extendable
pascalcase@0.1.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\pascalcase
debug@2.6.9 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\snapdragon\node_modules\debug
ms@2.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\snapdragon\node_modules\ms
define-property@0.2.5 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\snapdragon\node_modules\define-property
extend-shallow@2.0.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\snapdragon\node_modules\extend-shallow
map-cache@0.2.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\map-cache
source-map@0.5.7 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\source-map
source-map-resolve@0.5.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\source-map-resolve
atob@2.1.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\atob
decode-uri-component@0.2.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\decode-uri-component
resolve-url@0.2.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\resolve-url
source-map-url@0.4.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\source-map-url
urix@0.1.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\urix
use@3.1.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\use
snapdragon-node@2.1.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\snapdragon-node
define-property@1.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\snapdragon-node\node_modules\define-property
is-descriptor@1.0.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\snapdragon-node\node_modules\is-descriptor
is-accessor-descriptor@1.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\snapdragon-node\node_modules\is-accessor-descriptor
is-data-descriptor@1.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\snapdragon-node\node_modules\is-data-descriptor
snapdragon-util@3.0.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\snapdragon-util
kind-of@3.2.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\snapdragon-util\node_modules\kind-of
to-regex@3.0.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\to-regex
define-property@2.0.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\define-property
is-descriptor@1.0.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\define-property\node_modules\is-descriptor
is-accessor-descriptor@1.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\define-property\node_modules\is-accessor-descriptor
is-data-descriptor@1.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\define-property\node_modules\is-data-descriptor
regex-not@1.0.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\regex-not
safe-regex@1.1.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\safe-regex
ret@0.1.15 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\ret
extglob@2.0.4 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\extglob
define-property@1.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\extglob\node_modules\define-property
is-descriptor@1.0.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\extglob\node_modules\is-descriptor
is-accessor-descriptor@1.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\extglob\node_modules\is-accessor-descriptor
is-data-descriptor@1.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\extglob\node_modules\is-data-descriptor
expand-brackets@2.1.4 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\expand-brackets
debug@2.6.9 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\expand-brackets\node_modules\debug
ms@2.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\expand-brackets\node_modules\ms
define-property@0.2.5 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\expand-brackets\node_modules\define-property
extend-shallow@2.0.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\expand-brackets\node_modules\extend-shallow
posix-character-classes@0.1.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\posix-character-classes
extend-shallow@2.0.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\extglob\node_modules\extend-shallow
fragment-cache@0.2.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\fragment-cache
nanomatch@1.2.13 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\nanomatch
is-windows@1.0.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\is-windows
object.pick@1.3.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\object.pick
normalize-path@2.1.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\anymatch\node_modules\normalize-path
remove-trailing-separator@1.1.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\remove-trailing-separator
async-each@1.0.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\async-each
glob-parent@3.1.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\glob-parent
is-glob@3.1.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\glob-parent\node_modules\is-glob
is-extglob@2.1.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\is-extglob
path-dirname@1.0.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\path-dirname
inherits@2.0.3 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\inherits
is-binary-path@1.0.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\is-binary-path
binary-extensions@1.13.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\binary-extensions
is-glob@4.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\is-glob
normalize-path@3.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\normalize-path
path-is-absolute@1.0.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\path-is-absolute
readdirp@2.2.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\readdirp
graceful-fs@4.1.15 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\graceful-fs
readable-stream@2.3.6 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\readdirp\node_modules\readable-stream
core-util-is@1.0.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\core-util-is
isarray@1.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\readdirp\node_modules\isarray
process-nextick-args@2.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\process-nextick-args
string_decoder@1.1.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\readdirp\node_modules\string_decoder
util-deprecate@1.0.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\util-deprecate
upath@1.1.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\upath
enmap@4.8.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\enmap
lodash@4.17.11 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\lodash
moment@2.24.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\moment
@types/node@10.12.27 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\@types\node
ansi-regex@2.1.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\ansi-regex
array-find-index@1.0.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\array-find-index
asn1@0.2.4 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\asn1
safer-buffer@2.1.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\safer-buffer
assert-plus@1.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\assert-plus
asynckit@0.4.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\asynckit
aws-sign2@0.7.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\aws-sign2
bcrypt-pbkdf@1.0.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\bcrypt-pbkdf
tweetnacl@0.14.5 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\tweetnacl
buffer-from@1.1.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\buffer-from
camelcase@2.1.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\camelcase
camelcase-keys@2.1.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\camelcase-keys
map-obj@1.0.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\map-obj
caseless@0.12.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\caseless
code-point-at@1.1.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\code-point-at
combined-stream@1.0.7 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\combined-stream
delayed-stream@1.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\delayed-stream
currently-unhandled@0.4.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\currently-unhandled
decamelize@1.2.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\decamelize
deep-extend@0.6.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\deep-extend
ecc-jsbn@0.1.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\ecc-jsbn
jsbn@0.1.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\jsbn
env-paths@1.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\env-paths
error-ex@1.3.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\error-ex
is-arrayish@0.2.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\is-arrayish
extend@3.0.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\extend
extsprintf@1.3.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\extsprintf
fast-deep-equal@2.0.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\fast-deep-equal
fast-json-stable-stringify@2.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\fast-json-stable-stringify
forever-agent@0.6.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\forever-agent
form-data@2.3.3 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\form-data
mime-types@2.1.22 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\mime-types
mime-db@1.38.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\mime-db
get-stdin@4.0.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\get-stdin
getpass@0.1.7 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\getpass
har-schema@2.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\har-schema
har-validator@5.1.3 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\har-validator
ajv@6.9.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\ajv
json-schema-traverse@0.4.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\json-schema-traverse
uri-js@4.2.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\uri-js
punycode@2.1.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\punycode
hosted-git-info@2.7.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\hosted-git-info
http-signature@1.2.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\http-signature
jsprim@1.4.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\jsprim
json-schema@0.2.3 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\json-schema
verror@1.10.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\verror
sshpk@1.16.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\sshpk
dashdash@1.14.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\dashdash
indent-string@2.1.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\indent-string
repeating@2.0.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\repeating
is-finite@1.0.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\is-finite
number-is-nan@1.0.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\number-is-nan
ini@1.3.5 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\ini
is-fullwidth-code-point@1.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\is-fullwidth-code-point
is-typedarray@1.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\is-typedarray
fd-slicer@1.0.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\fd-slicer
pend@1.2.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\pend
is-utf8@0.2.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\is-utf8
isarray@0.0.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\isarray
isstream@0.1.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\isstream
json-stringify-safe@5.0.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\json-stringify-safe
jsonfile@4.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\jsonfile
load-json-file@1.1.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\load-json-file
parse-json@2.2.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\parse-json
pify@2.3.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\pify
pinkie-promise@2.0.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\pinkie-promise
pinkie@2.0.4 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\pinkie
strip-bom@2.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\strip-bom
loud-rejection@1.6.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\loud-rejection
signal-exit@3.0.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\signal-exit
meow@3.7.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\meow
minimist@1.2.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\minimist
normalize-package-data@2.5.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\normalize-package-data
resolve@1.10.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\resolve
path-parse@1.0.6 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\path-parse
semver@5.6.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\semver
validate-npm-package-license@3.0.4 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\validate-npm-package-license
spdx-correct@3.1.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\spdx-correct
spdx-expression-parse@3.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\spdx-expression-parse
spdx-exceptions@2.2.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\spdx-exceptions
spdx-license-ids@3.0.3 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\spdx-license-ids
object-assign@4.1.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\object-assign
read-pkg-up@1.0.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\read-pkg-up
find-up@1.1.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\find-up
path-exists@2.1.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\find-up\node_modules\path-exists
read-pkg@1.1.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\read-pkg
path-type@1.1.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\path-type
redent@1.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\redent
strip-indent@1.0.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\strip-indent
trim-newlines@1.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\trim-newlines
ms@2.1.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\ms
oauth-sign@0.9.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\oauth-sign
object-keys@0.4.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\object-keys
path-exists@3.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\path-exists
performance-now@2.1.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\performance-now
progress-stream@1.2.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\progress-stream
speedometer@0.1.4 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\speedometer
through2@0.2.3 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\through2
readable-stream@1.1.14 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\readable-stream
string_decoder@0.10.31 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\string_decoder
xtend@2.1.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\xtend
psl@1.1.31 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\psl
single-line-log@1.1.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\single-line-log
string-width@1.0.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\string-width
strip-ansi@3.0.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\strip-ansi
strip-json-comments@2.0.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\strip-json-comments
throttleit@0.0.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\throttleit
tunnel-agent@0.6.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\tunnel-agent
typedarray@0.0.6 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\typedarray
universalify@0.1.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\universalify
electron@4.0.5 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\electron
electron-download@4.1.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\electron-download
debug@3.2.6 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\debug
fs-extra@4.0.3 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\fs-extra
nugget@2.0.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\nugget
debug@2.6.9 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\nugget\node_modules\debug
ms@2.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\nugget\node_modules\ms
pretty-bytes@1.0.4 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\pretty-bytes
request@2.88.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\request
aws4@1.8.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\aws4
qs@6.5.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\qs
tough-cookie@2.4.3 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\tough-cookie
punycode@1.4.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\tough-cookie\node_modules\punycode
uuid@3.3.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\uuid
rc@1.2.8 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\rc
sumchecker@2.0.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\sumchecker
debug@2.6.9 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\sumchecker\node_modules\debug
ms@2.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\sumchecker\node_modules\ms
extract-zip@1.6.7 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\extract-zip
concat-stream@1.6.2 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\concat-stream
readable-stream@2.3.6 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\concat-stream\node_modules\readable-stream
isarray@1.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\concat-stream\node_modules\isarray
string_decoder@1.1.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\concat-stream\node_modules\string_decoder
debug@2.6.9 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\extract-zip\node_modules\debug
ms@2.0.0 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\extract-zip\node_modules\ms
yauzl@2.4.1 C:\Users\CuntarD\Desktop\Electron-Application-master\node_modules\yauzl
PS C:\Users\CuntarD\Desktop\Electron-Application-master> ./node_modules/.bin/electron-rebuild
./node_modules/.bin/electron-rebuild : The term './node_modules/.bin/electron-rebuild' is not recognized as the name of a cmdlet, function, script file, or operable program. 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 enmap@4.8.1 requires a peer of better-sqlite-pool@github:eslachance/better-sqlite-pool but none is installed. You must install peer dependencies yourself.
npm WARN bank-account@1.0.0 No repository field.
npm WARN bank-account@1.0.0 No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ electron-rebuild@1.8.4
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. @Custardcs

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 enmap@4.8.1 requires a peer of better-sqlite-pool@github:eslachance/better-sqlite-pool but none is installed. You must install peer dependencies yourself.
npm WARN bank-account@1.0.0 No repository field.
npm WARN bank-account@1.0.0 No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ electron-rebuild@1.8.4
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, 'serialport', only this will crash the process

only crash in webpack, using process.dlopen, but run well withount webpack.

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 (#126 (comment)) 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.

Here

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, ๐Ÿ˜„ 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 #223 (comment)

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 (lib/, build/better_sqlite3.node and package.json are enough):

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: [...]
      },
    ]),
  ]
}

then to package your app you only need to include your webpack output files with tools like electron-builder

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://192.168.43.100: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://192.168.43.100: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:

  1. In my existing Angular/Electron project, npm i better-sqlite3 --save
  2. 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
  3. 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...
  1. 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);
  1. Compile and run the project
  2. Check the console for the comment and the db object
  3. Check the root of your project, there will be a file called mytest.db
  4. 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?

EDIT: my temporary hacky solution.

inside package.json, adding a new script

"start-sql": "ELECTRON_RUN_AS_NODE=1 cross-env HOT=1 NODE_ENV=development electron -r @babel/register ./app/sqlite_background.js"

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:

Installation on Windows 10

  1. Install windows-build-tools globally
$ npm install -g windows-build-tools
  1. Install python 2.7 & add it to the path

  2. Go to C:\Users%USERNAME%.windows-build-tools and run BuildTools_Full.exe or vs_BuildTools.exe. Then open BuildTools and click Modify. Finally install VC++ 2015.3 v14.00(v140) toolset for desktop.

  3. Create a TypeScript template with Electron Forge

$ npx create-electron-app better-sqlite3-test --template=typescript-webpack
  1. Install better-sqlite3 & @types/better-sqlite3
$ npm install better-sqlite3
$ npm install -D @types/better-sqlite3

NOTE: Thanks to electron-forge, it handles compiling native modules automatically. See @marshallofsound/webpack-asset-relocator-loader inside webpack.rules.js

Add better-sqlite3 code to src/index.ts

import SQLite from 'better-sqlite3'
.
.
.
const db = SQLite('data.db')
.
.
.
const createWindow = () => {
	.
	.
	.
	mainWindow.webContents.once('dom-ready', () => {
		const tableName = 'cats'
		const createTable = db.prepare(
			`CREATE TABLE IF NOT EXISTS ${tableName} (name CHAR(20), age INT)`
		)
		createTable.run()

		const insert = db.prepare(
			`INSERT INTO ${tableName} (name, age) VALUES (@name, @age)`
		)
		const insertMany = db.transaction((cats) => {
			for (const cat of cats) insert.run(cat)
		})

		const selectAllCats = db.prepare(`SELECT * FROM ${tableName}`)
		const rows = selectAllCats.all()

		if (!rows.length)
			insertMany([
				{ name: 'Joey', age: 2 },
				{ name: 'Sally', age: 4 },
				{ name: 'Junior', age: 1 },
			])

		rows.forEach((row) => {
			console.log(row)
		})
	})
	.
	.
	.
}
.
.
.

Run start script

$ yarn start # runs `electron-forge start` 

I'll add the installation steps for Mac soon but should be much simpler than Windows :)

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

Tried Electron v8.2.5 with vue-cli-plugin-electron-builder on macOS Catalina,

Tested with simply

import sqlite3 from 'better-sqlite3'
sqlite3(`${__dirname}/test.db`)

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

Screen Shot 2563-05-10 at 19 18 54

If I removed the two lines, no error occurs.

nklayman/vue-cli-plugin-electron-builder#740

NVM, fixed with simply

// vue.config.js

module.exports = {
  pluginOptions: {
    electronBuilder: {
      externals: ['better-sqlite3']
    }
  }
}

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 writes (i.e. I/O operation) in Web Workers, only reads. For writes, you might only wrap in functions, observables, or even setTimeout.

Otherwise, heavy joins / query (i.e. CPU operation) 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.

I've tried using the electron-rebuild but it did not work.

it return this log that i'm not familiarized with:

 0007FF6CAC03BDA VR_GetStringForHmdError+376554
 2: 00007FF6CA095C69 node::InternalCallbackScope::Close+569
 3: 00007FF6CA095ADB node::InternalCallbackScope::Close+171
 4: 00007FF6CA09599D node::InternalCallbackScope::~InternalCallbackScope+13
 5: 00007FF6CA0B2179 node::EmitAsyncDestroy+104889
 6: 00007FF6CA0DA698 uv_timer_again+184
 7: 00007FF6CA0DD3F2 uv_run+178
 8: 00007FF6C7940F31 v8::OutputStream::WriteHeapStatsChunk+13873
 9: 00007FF6C9959341 uv_mutex_unlock+2171665
10: 00007FF6CA11D259 uv_gettimeofday+247337
11: 00007FF6CA11CFE0 uv_gettimeofday+246704
12: 00007FF6C999538A uv_mutex_unlock+2417498
13: 00007FF6C9994D2F uv_mutex_unlock+2415871
14: 00007FF6C999D014 uv_cond_signal+13732
15: 00007FF6C999CCCF uv_cond_signal+12895
16: 00007FF88E6A5C0D CallWindowProcW+957
17: 00007FF88E6A5602 DispatchMessageW+498
18: 00007FF88E6BC08B DialogBoxIndirectParamAorW+1307
19: 00007FF88E6BBCFF DialogBoxIndirectParamAorW+399
20: 00007FF88E6BBBC2 DialogBoxIndirectParamAorW+82
21: 00007FF88E6BBB58 DialogBoxIndirectParamW+24
22: 00007FF87CE2288A TaskDialogIndirect+5594
23: 00007FF87CE22812 TaskDialogIndirect+5474
24: 00007FF6C78FE98C v8::MemorySpan<unsigned char const >::MemorySpan<unsigned char const >+73468
25: 00007FF6C78FE20B v8::MemorySpan<unsigned char const >::MemorySpan<unsigned char const >+71547
26: 00007FF6C7840C24 node::FreePlatform+10244
27: 00007FF6C78462F5 node::FreePlatform+32469
28: 00007FF6C83C448B v8::CFunction::CFunction+206939
29: 00007FF6C83C3918 v8::CFunction::CFunction+204008
30: 00007FF6C83C2E73 v8::CFunction::CFunction+201283
31: 00007FF6C83C2A97 v8::CFunction::CFunction+200295
32: 00007FF6C8D071DC v8_inspector::V8StackTraceId::ToString+2985404
33: 00007FF6C8C9A3D5 v8_inspector::V8StackTraceId::ToString+2539445
34: 00007FF6C8C93B5F v8_inspector::V8StackTraceId::ToString+2512703
35: 00007FF6C8C9A3D5 v8_inspector::V8StackTraceId::ToString+2539445
36: 00007FF6C8D4B36F v8_inspector::V8StackTraceId::ToString+3264335
37: 00007FF6C8CBBA2D v8_inspector::V8StackTraceId::ToString+2676237
38: 00007FF6C8C97D8C v8_inspector::V8StackTraceId::ToString+2529644
39: 00007FF6C8481FE6 v8::Unwinder::PCIsInV8+3350
40: 00007FF6C848268C v8::Unwinder::PCIsInV8+5052
41: 00007FF6C848278F v8::Unwinder::PCIsInV8+5311
42: 00007FF6C84A3BA8 v8::Unwinder::PCIsInV8+141528
43: 00007FF6C84A3995 v8::Unwinder::PCIsInV8+140997
44: 00007FF6C78CE63E v8::HeapStatistics::external_memory+3950
45: 00007FF6C995E0AA uv_mutex_unlock+2191482
46: 00007FF6C995DC47 uv_mutex_unlock+2190359
47: 00007FF6CA11D2C6 uv_gettimeofday+247446
48: 00007FF6CA11CFE0 uv_gettimeofday+246704
49: 00007FF6C9995494 uv_mutex_unlock+2417764
50: 00007FF6C9994BFE uv_mutex_unlock+2415566
51: 00007FF6CA11D868 uv_gettimeofday+248888
52: 00007FF6C9944F2A uv_mutex_unlock+2088698
53: 00007FF6C8FDB3B2 v8_inspector::V8StackTraceId::ToString+5951378
54: 00007FF6C8FDB283 v8_inspector::V8StackTraceId::ToString+5951075
55: 00007FF6C8FDCF01 v8_inspector::V8StackTraceId::ToString+5958369
56: 00007FF6C8FD8C2D v8_inspector::V8StackTraceId::ToString+5941261
57: 00007FF6C8EDDE3D v8_inspector::V8StackTraceId::ToString+4913693
58: 00007FF6C8EDE9E1 v8_inspector::V8StackTraceId::ToString+4916673
59: 00007FF6C8EDE6A3 v8_inspector::V8StackTraceId::ToString+4915843
60: 00007FF6C9E49533 IsSandboxedProcess+310787
61: 00007FF6C82B2906 v8::ResourceConstraints::ResourceConstraints+1386534
62: 00007FF6C781140B Ordinal0+5131
63: 00007FF6CCC7FB62 node::AsyncResource::CallbackScope::CallbackScope+21767010
64: 00007FF88D1D7BD4 BaseThreadInitThunk+20
65: 00007FF88EBCCE51 RtlUserThreadStart+33

Versions:

'''
"better-sqlite3": "^7.0.1",
"electron": "^9.0.0",
"electron-builder": "^22.6.1"
'''

Please talk commun language I'm not super expert at all.

Thanks!

Error:

image

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 on electron v9.0.3

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:

  1. Do the developers have an idea how this might work?
  2. 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 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.

I've tried using the electron-rebuild but it did not work.
....

Hey @dkcamargox

I am facing a similar issue, could you resolve it?

This is how I try to instantiate the db.

const db = new Database(path.resolve(__dirname, 'app.db'));

Error from built app:

SqliteError: unable to open database file at new Database

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

please text me on twitter, or mail me the news

twitter: @dkcamargox
mail: gravata.hu3@gmail.com

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

how do you run the build?

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.

It seems that downgrading to better-sqlite@6 fixes it.

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

@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  dependencies=better-sqlite3@7.1.1, nodejieba@2.5.1 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 restarted my machine it worked again - this is kinda weird if someone has an explanation for me that would be toooo great :D

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

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

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 made the change. It's either a reboot or npm config set msvs_version 2017. It's so weird and unreliable. ๐Ÿ˜•

but you will have to bundle JVM along with the app

Been doing that for years with Excelsior and got so tired doing hours of analysis and then packaging.

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

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 -

  1. What am I missing
  2. How is the selection of which folders to look for the binding is done
  3. 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
  • Check for the functionality and create yourself a backup if it works.

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.