Skip to main content
The 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 where better-sqlite3 (or a library that wraps it, such as quick.db) is first required:
Error: Could not locate the bindings file. Tried:
 /application/node_modules/better-sqlite3/build/better_sqlite3.node
 /application/node_modules/better-sqlite3/build/Debug/better_sqlite3.node
 /application/node_modules/better-sqlite3/build/Release/better_sqlite3.node

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

1

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

Update your package.json

Open your 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
{
  "dependencies": {
    "better-sqlite3": "^11.10.0",
    "quick.db": "^9.1.7"
  }
}
Replace the version numbers with the latest stable releases you found in Step 1.
3

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/
You can remove these from the File Manager in the Virtus Cloud dashboard, or exclude them from your upload entirely (Virtus Cloud removes node_modules and .npm automatically — but removing package-lock.json manually ensures a fully clean lockfile is generated on the next install).
4

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.
After updating, confirm the installed version by checking the better-sqlite3 entry in your package-lock.json or by adding a temporary console.log(require('better-sqlite3/package.json').version) line to your startup code.
If you continue to encounter the Could not locate the bindings file error after updating, contact the Virtus Cloud support team.