Could not locate the bindings file. Discord Bot

Recently my Discord bot project has been returning the “Bindings file not found” error for the node module better-sqlite3 (Which I haven’t even installed). I have tried installing the module with npm install better-sqlite3 (and npm rebuild better-sqlite3) but it still gives the error. Thanks in advance for any help.

The error:

/rbd/pnpm-volume/fcc12d65-2833-4609-b678-23fc7581e01e/node_modules/.registry.npmjs.org/bindings/1.5.0/node_modules/bindings/bindings.js:135
  throw err;
  ^
Error: Could not locate the bindings file. Tried:
 → /rbd/pnpm-volume/fcc12d65-2833-4609-b678-23fc7581e01e/node_modules/.registry.npmjs.org/better-sqlite3/6.0.1/node_modules/better-sqlite3/build/better_sqlite3.node
 → /rbd/pnpm-volume/fcc12d65-2833-4609-b678-23fc7581e01e/node_modules/.registry.npmjs.org/better-sqlite3/6.0.1/node_modules/better-sqlite3/build/Debug/better_sqlite3.node
 → /rbd/pnpm-volume/fcc12d65-2833-4609-b678-23fc7581e01e/node_modules/.registry.npmjs.org/better-sqlite3/6.0.1/node_modules/better-sqlite3/build/Release/better_sqlite3.node
 → /rbd/pnpm-volume/fcc12d65-2833-4609-b678-23fc7581e01e/node_modules/.registry.npmjs.org/better-sqlite3/6.0.1/node_modules/better-sqlite3/out/Debug/better_sqlite3.node
 → /rbd/pnpm-volume/fcc12d65-2833-4609-b678-23fc7581e01e/node_modules/.registry.npmjs.org/better-sqlite3/6.0.1/node_modules/better-sqlite3/Debug/better_sqlite3.node
 → /rbd/pnpm-volume/fcc12d65-2833-4609-b678-23fc7581e01e/node_modules/.registry.npmjs.org/better-sqlite3/6.0.1/node_modules/better-sqlite3/out/Release/better_sqlite3.node
 → /rbd/pnpm-volume/fcc12d65-2833-4609-b678-23fc7581e01e/node_modules/.registry.npmjs.org/better-sqlite3/6.0.1/node_modules/better-sqlite3/Release/better_sqlite3.node
 → /rbd/pnpm-volume/fcc12d65-2833-4609-b678-23fc7581e01e/node_modules/.registry.npmjs.org/better-sqlite3/6.0.1/node_modules/better-sqlite3/build/default/better_sqlite3.node
 → /rbd/pnpm-volume/fcc12d65-2833-4609-b678-23fc7581e01e/node_modules/.registry.npmjs.org/better-sqlite3/6.0.1/node_modules/better-sqlite3/compiled/12.0.0/linux/x64/better_sqlite3.node
 → /rbd/pnpm-volume/fcc12d65-2833-4609-b678-23fc7581e01e/node_modules/.registry.npmjs.org/better-sqlite3/6.0.1/node_modules/better-sqlite3/addon-build/release/install-root/better_sqlite3.node
 → /rbd/pnpm-volume/fcc12d65-2833-4609-b678-23fc7581e01e/node_modules/.registry.npmjs.org/better-sqlite3/6.0.1/node_modules/better-sqlite3/addon-build/debug/install-root/better_sqlite3.node
 → /rbd/pnpm-volume/fcc12d65-2833-4609-b678-23fc7581e01e/node_modules/.registry.npmjs.org/better-sqlite3/6.0.1/node_modules/better-sqlite3/addon-build/default/install-root/better_sqlite3.node
 → /rbd/pnpm-volume/fcc12d65-2833-4609-b678-23fc7581e01e/node_modules/.registry.npmjs.org/better-sqlite3/6.0.1/node_modules/better-sqlite3/lib/binding/node-v72-linux-x64/better_sqlite3.node
    at bindings (/rbd/pnpm-volume/fcc12d65-2833-4609-b678-23fc7581e01e/node_modules/.registry.npmjs.org/bindings/1.5.0/node_modules/bindings/bindings.js:126:9)
    at Object.<anonymous> (/rbd/pnpm-volume/fcc12d65-2833-4609-b678-23fc7581e01e/node_modules/.registry.npmjs.org/better-sqlite3/6.0.1/node_modules/better-sqlite3/lib/database.js:6:40)
    at Module._compile (internal/modules/cjs/loader.js:759:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
    at Module.load (internal/modules/cjs/loader.js:628:32)
    at Function.Module._load (internal/modules/cjs/loader.js:555:12)
    at Module.require (internal/modules/cjs/loader.js:666:19)
    at require (internal/modules/cjs/helpers.js:16:16)
    at Object.<anonymous> (/rbd/pnpm-volume/fcc12d65-2833-4609-b678-23fc7581e01e/node_modules/.registry.npmjs.org/better-sqlite3/6.0.1/node_modules/better-sqlite3/lib/index.js:2:18)
    at Module._compile (internal/modules/cjs/loader.js:759:30)

My node modules:

"discord": "^0.8.2",
"discord-jokes": "^1.0.12",
"discord.js": "^12.3.1",
"express": "^4.17.1",
"get-title-at-url": "^1.1.7",
"getyoutubesubscriber": "^0.1.4",
"node-opus": "^0.3.3",
"nodemon": "^2.0.4",
"opusscript": "0.0.7",
"parse-ms": "^2.1.0",
"quick.db": "^7.1.1",
"random-facts": "^1.0.6",
"random-image-js": "^1.1.7",
"request": "^2.88.2",
"roastme": "^0.0.1",
"random-puppy": "^1.1.0",
"ffmpeg-static": "^4.2.7",
"utf-8-validate": "^5.0.2",
"bufferutil": "^4.0.1"

Try running enable-pnpm in the console, this will usually fix it.

1 Like

Your quickdb requires it better-sqlite3 iirc. I think the user above’s suggestion is good, you can also try pnpm rebuild sqlite3. I remeber encountering this issue with running AuroraOS on windows sadly, I just got lazy of fixing things and recoded it to use endb

3 Likes

I got lazy, so I just rewrote it.
wut :joy:

1 Like

Thanks, this seems to have fixed it!

1 Like