Error: Could not locate the bindings file. Tried: Please help!


#1

Hello, I recently got this error on my discord bot and have no clue what to do with it. Please help :frowning:

/rbd/pnpm-volume/518345f8-3bda-4de8-b1c7-c3da5828243e/node_modules/.registry.npmjs.org/bindings/1.3.0/node_modules/bindings/bindings.js:96

6:34 PM

throw err

6:34 PM

^

6:34 PM

6:34 PM

Error: Could not locate the bindings file. Tried:

6:34 PM

→ /rbd/pnpm-volume/518345f8-3bda-4de8-b1c7-c3da5828243e/node_modules/.registry.npmjs.org/better-sqlite3/4.1.4/node_modules/better-sqlite3/build/better_sqlite3.node

6:34 PM

→ /rbd/pnpm-volume/518345f8-3bda-4de8-b1c7-c3da5828243e/node_modules/.registry.npmjs.org/better-sqlite3/4.1.4/node_modules/better-sqlite3/build/Debug/better_sqlite3.node

6:34 PM

→ /rbd/pnpm-volume/518345f8-3bda-4de8-b1c7-c3da5828243e/node_modules/.registry.npmjs.org/better-sqlite3/4.1.4/node_modules/better-sqlite3/build/Release/better_sqlite3.node

6:34 PM

→ /rbd/pnpm-volume/518345f8-3bda-4de8-b1c7-c3da5828243e/node_modules/.registry.npmjs.org/better-sqlite3/4.1.4/node_modules/better-sqlite3/out/Debug/better_sqlite3.node

6:34 PM

→ /rbd/pnpm-volume/518345f8-3bda-4de8-b1c7-c3da5828243e/node_modules/.registry.npmjs.org/better-sqlite3/4.1.4/node_modules/better-sqlite3/Debug/better_sqlite3.node

6:34 PM

→ /rbd/pnpm-volume/518345f8-3bda-4de8-b1c7-c3da5828243e/node_modules/.registry.npmjs.org/better-sqlite3/4.1.4/node_modules/better-sqlite3/out/Release/better_sqlite3.node

6:34 PM

→ /rbd/pnpm-volume/518345f8-3bda-4de8-b1c7-c3da5828243e/node_modules/.registry.npmjs.org/better-sqlite3/4.1.4/node_modules/better-sqlite3/Release/better_sqlite3.node

6:34 PM

→ /rbd/pnpm-volume/518345f8-3bda-4de8-b1c7-c3da5828243e/node_modules/.registry.npmjs.org/better-sqlite3/4.1.4/node_modules/better-sqlite3/build/default/better_sqlite3.node

6:34 PM

→ /rbd/pnpm-volume/518345f8-3bda-4de8-b1c7-c3da5828243e/node_modules/.registry.npmjs.org/better-sqlite3/4.1.4/node_modules/better-sqlite3/compiled/8.14.0/linux/x64/better_sqlite3.node

6:34 PM

at bindings (/rbd/pnpm-volume/518345f8-3bda-4de8-b1c7-c3da5828243e/node_modules/.registry.npmjs.org/bindings/1.3.0/node_modules/bindings/bindings.js:93:9)

6:34 PM

at Object.<anonymous> (/rbd/pnpm-volume/518345f8-3bda-4de8-b1c7-c3da5828243e/node_modules/.registry.npmjs.org/better-sqlite3/4.1.4/node_modules/better-sqlite3/lib/database.js:4:40)

at Module._compile (module.js:653:30)

at Object.Module._extensions…js (module.js:664:10)

at Module.load (module.js:566:32)

at tryModuleLoad (module.js:506:12)

at Function.Module._load (module.js:498:3)

at Module.require (module.js:597:17)

at require (internal/module.js:11:18)

at Object.<anonymous> (/rbd/pnpm-volume/518345f8-3bda-4de8-b1c7-c3da5828243e/node_modules/.registry.npmjs.org/better-sqlite3/4.1.4/node_modules/better-sqlite3/index.js:2:18)


#2

Alright, this is weird, but I cut and pasted the dependencies I used for my code and the bot works fine now? I don’t exactly know what happened? But I would still like to know I can prevent this from happening again. Thanks!


#3

Hey @MichTheKid, this is an error we see from time to time, particularly with the better-sqlite3 package. Please take a look at Error: Could not locate the bindings file for a solution that typically resolves the problem.


#4

Ah, probably what happened is that when you removed and readded your dependencies you forced a pnpm install of the packages similarly to what would happen if you followed the steps in the response I linked to.

We don’t have a reliable permanent resolution for this - it typically just requires a reinstall which can be triggered in a few different ways (as you’ve noticed). Sorry for the bother!