Error: Could not locate the bindings file - Better sqlite 3

I’ve been trying to fix this error for about a week after updating to v12 of node.js
UnhandledPromiseRejectionWarning: Error: Could not locate the bindings file. Tried:

11:00 AM

→ /rbd/pnpm-volume/ea8449d4-9c5e-4119-85c7-d79454bacaa7/node_modules/.registry.npmjs.org/better-sqlite3/4.2.0/node_modules/better-sqlite3/build/better_sqlite3.node

11:00 AM

→ /rbd/pnpm-volume/ea8449d4-9c5e-4119-85c7-d79454bacaa7/node_modules/.registry.npmjs.org/better-sqlite3/4.2.0/node_modules/better-sqlite3/build/Debug/better_sqlite3.node

11:00 AM

→ /rbd/pnpm-volume/ea8449d4-9c5e-4119-85c7-d79454bacaa7/node_modules/.registry.npmjs.org/better-sqlite3/4.2.0/node_modules/better-sqlite3/build/Release/better_sqlite3.node

11:00 AM

→ /rbd/pnpm-volume/ea8449d4-9c5e-4119-85c7-d79454bacaa7/node_modules/.registry.npmjs.org/better-sqlite3/4.2.0/node_modules/better-sqlite3/out/Debug/better_sqlite3.node

11:00 AM

→ /rbd/pnpm-volume/ea8449d4-9c5e-4119-85c7-d79454bacaa7/node_modules/.registry.npmjs.org/better-sqlite3/4.2.0/node_modules/better-sqlite3/Debug/better_sqlite3.node

11:00 AM

→ /rbd/pnpm-volume/ea8449d4-9c5e-4119-85c7-d79454bacaa7/node_modules/.registry.npmjs.org/better-sqlite3/4.2.0/node_modules/better-sqlite3/out/Release/better_sqlite3.node

11:00 AM

→ /rbd/pnpm-volume/ea8449d4-9c5e-4119-85c7-d79454bacaa7/node_modules/.registry.npmjs.org/better-sqlite3/4.2.0/node_modules/better-sqlite3/Release/better_sqlite3.node

11:00 AM

→ /rbd/pnpm-volume/ea8449d4-9c5e-4119-85c7-d79454bacaa7/node_modules/.registry.npmjs.org/better-sqlite3/4.2.0/node_modules/better-sqlite3/build/default/better_sqlite3.node

11:00 AM

→ /rbd/pnpm-volume/ea8449d4-9c5e-4119-85c7-d79454bacaa7/node_modules/.registry.npmjs.org/better-sqlite3/4.2.0/node_modules/better-sqlite3/compiled/12.0.0/linux/x64/better_sqlite3.node

11:00 AM

→ /rbd/pnpm-volume/ea8449d4-9c5e-4119-85c7-d79454bacaa7/node_modules/.registry.npmjs.org/better-sqlite3/4.2.0/node_modules/better-sqlite3/addon-build/release/install-root/better_sqlite3.node

11:00 AM

→ /rbd/pnpm-volume/ea8449d4-9c5e-4119-85c7-d79454bacaa7/node_modules/.registry.npmjs.org/better-sqlite3/4.2.0/node_modules/better-sqlite3/addon-build/debug/install-root/better_sqlite3.node

11:00 AM

→ /rbd/pnpm-volume/ea8449d4-9c5e-4119-85c7-d79454bacaa7/node_modules/.registry.npmjs.org/better-sqlite3/4.2.0/node_modules/better-sqlite3/addon-build/default/install-root/better_sqlite3.node

11:00 AM

→ /rbd/pnpm-volume/ea8449d4-9c5e-4119-85c7-d79454bacaa7/node_modules/.registry.npmjs.org/better-sqlite3/4.2.0/node_modules/better-sqlite3/lib/binding/node-v72-linux-x64/better_sqlite3.node

11:00 AM

at bindings (/rbd/pnpm-volume/ea8449d4-9c5e-4119-85c7-d79454bacaa7/node_modules/.registry.npmjs.org/bindings/1.5.0/node_modules/bindings/bindings.js:126:9)

11:00 AM

at Object. (/rbd/pnpm-volume/ea8449d4-9c5e-4119-85c7-d79454bacaa7/node_modules/.registry.npmjs.org/better-sqlite3/4.2.0/node_modules/better-sqlite3/lib/database.js:4:40)

11:00 AM

at Module._compile (internal/modules/cjs/loader.js:759:30)

11:00 AM

at Object.Module._extensions…js (internal/modules/cjs/loader.js:770:10)

11:00 AM

at Module.load (internal/modules/cjs/loader.js:628:32)

11:00 AM

at Function.Module._load (internal/modules/cjs/loader.js:555:12)

11:00 AM

at Module.require (internal/modules/cjs/loader.js:666:19)

11:00 AM

at require (internal/modules/cjs/helpers.js:16:16)

11:00 AM

at Object. (/rbd/pnpm-volume/ea8449d4-9c5e-4119-85c7-d79454bacaa7/node_modules/.registry.npmjs.org/better-sqlite3/4.2.0/node_modules/better-sqlite3/index.js:2:18)

11:00 AM

at Module._compile (internal/modules/cjs/loader.js:759:30)

11:00 AM

(node:23835) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 4)

I’ve looked at the other forum posts with the exact same error but none of the solutions have worked. My engine is actually at v12 and it isnt bugged.

1 Like
rm node_modules && enable-npm && npm i

That does work if you run then if you put it in glitch.json the right way.

I don’t think I have a file named glitch.json? I’ve tried that command in the terminal and it didn’t seem to work. Am I missing anything?

I actually now think it’s better-sqlite3 so maybe ask a question or something

I’m confused what you’re trying to say. The issue is with better-sqlite3 however I can’t figure out how to fix it.

Issue reports.

Hi @LordOfLlamaz - if you change your version of Node to something different (where it was before you updated it to v12) does it work again? I can’t tell from the better-sqlite3 page what version(s) of Node they support.

1 Like