Better-SQLite3 can cause some issues if not setup correctly. We provide a complete working version of Zeltux with better-sqlite3 precompiled when working on Windows, the environment it was created for.

If you wish to use the bot on another operating system then you will just need to reinstall better-sqlite3 yourself, which is very easy if done properly.

Check out the better-sqlite page on npm to find out how to do this.

Better-Sqlite3's dependencies

better-sqlite3, similarly to a lot of modules, gets compiled using node-gyp which has 2 very important requirements: Python 2.7 and the C++ Build Tools. For windows, open up an Elevated (Administrator) command prompt and run the following FIRST, before installing better-sqlite3: npm i --vs2015 -g windows-build-tools. For linux, you need sudo apt-get install build-essential and you need to figure out how to install Python 2.7 (NOT Python 3!) on your system.

Better-Sqlite3 - FATAL ERROR: v8::ToLocalChecked Empty MaybeLocal.

This issue should be fixed by rebuilding integer and better-sqlite3

npm rebuild integer --update-binary
npm rebuild better-sqlite3 --update-binary

Better-Sqlite3 - TypeError: Cannot open database because the directory does not exist

Within the root directory of the bot, create a folder called data. This should solve your issue.

Better-Sqlite3 - compiled against a different Node.js version

Update your node.js to the latest version, then this error should be fixed.

Better-Sqlite3 - Reinstall

To reinstall better-sqlite3 follow these steps:

  1. Delete the node_modules folder

  2. Delete the package-lock.json fold

  3. Run npm install (this will take a long time) OR upload this file.

Other Better-SQLite3 Issues

Check out Better-Sqlite3's installation troubleshooting guide.

If you need any help, feel free to get in touch on our discord server.