Could not locate the bindings file error for better-sqlite3 is a native module compilation issue. Unlike pure JavaScript packages, better-sqlite3 contains native C++ bindings that must be compiled specifically for the Node.js version running on the platform. When the installed version of better-sqlite3 was compiled against an older Node.js version and is then loaded in a newer runtime, the compiled .node binary is incompatible and cannot be located. Virtus Cloud runs Node.js LTS v22, and better-sqlite3 versions 11.x.x and earlier do not support this runtime — causing the error on every startup.
When Does It Occur?
You’ll see the following error in your application logs during startup, typically at the point wherebetter-sqlite3 (or a library that wraps it, such as quick.db) is first required:
Why Does It Occur?
better-sqlite3 versions 11.x.x and earlier do not include prebuilt binaries for Node.js LTS v22. When the package is installed and then loaded inside a Node.js v22 runtime, the module loader cannot find a compatible compiled binary — resulting in the Could not locate the bindings file error.
If you use quick.db, note that it wraps better-sqlite3 internally. An outdated version of quick.db will pull in an old version of better-sqlite3 and produce the same error.
How to Fix It
Check the latest versions
Before updating, check the current stable releases:You need a version of
better-sqlite3 that explicitly lists Node.js v22 in its supported runtimes.Update your package.json
Open your Replace the version numbers with the latest stable releases you found in Step 1.
package.json and update better-sqlite3 to the latest version. If you use quick.db, update it too — a newer version of quick.db will depend on a compatible version of better-sqlite3 automatically.package.json
Remove cached build artifacts
Before redeploying, delete the following files and directories from your project to force a clean installation. Leaving old build artifacts in place can cause the package manager to reuse incompatible compiled binaries:
node_modules/package-lock.json.npm/
node_modules and .npm automatically — but removing package-lock.json manually ensures a fully clean lockfile is generated on the next install).Redeploy your application
Save your updated
package.json and trigger a new deployment. Virtus Cloud will run npm install with the updated version constraints, download the correct prebuilt binary for Node.js v22, and start your application.Watch the deployment logs to confirm that better-sqlite3 installs without errors before your application process starts.If you continue to encounter the
Could not locate the bindings file error after updating, contact the Virtus Cloud support team.