Better-sqlite's bindings not found

Happens when I try to install quick.db, I get some weird error saying the bindings could not be found

/rbd/pnpm-volume/2c4aeca6-bdf6-455e-ac76-4eeb4a408fa4/node_modules/bindings/bindings.js:135
  throw err;
  ^
Error: Could not locate the bindings file. Tried:
 → /rbd/pnpm-volume/2c4aeca6-bdf6-455e-ac76-4eeb4a408fa4/node_modules/better-sqlite3/build/better_sqlite3.node
 → /rbd/pnpm-volume/2c4aeca6-bdf6-455e-ac76-4eeb4a408fa4/node_modules/better-sqlite3/build/Debug/better_sqlite3.node
 → /rbd/pnpm-volume/2c4aeca6-bdf6-455e-ac76-4eeb4a408fa4/node_modules/better-sqlite3/build/Release/better_sqlite3.node
 → /rbd/pnpm-volume/2c4aeca6-bdf6-455e-ac76-4eeb4a408fa4/node_modules/better-sqlite3/out/Debug/better_sqlite3.node
 → /rbd/pnpm-volume/2c4aeca6-bdf6-455e-ac76-4eeb4a408fa4/node_modules/better-sqlite3/Debug/better_sqlite3.node
 → /rbd/pnpm-volume/2c4aeca6-bdf6-455e-ac76-4eeb4a408fa4/node_modules/better-sqlite3/out/Release/better_sqlite3.node
 → /rbd/pnpm-volume/2c4aeca6-bdf6-455e-ac76-4eeb4a408fa4/node_modules/better-sqlite3/Release/better_sqlite3.node
 → /rbd/pnpm-volume/2c4aeca6-bdf6-455e-ac76-4eeb4a408fa4/node_modules/better-sqlite3/build/default/better_sqlite3.node
 → /rbd/pnpm-volume/2c4aeca6-bdf6-455e-ac76-4eeb4a408fa4/node_modules/better-sqlite3/compiled/16.6.1/linux/x64/better_sqlite3.node
 → /rbd/pnpm-volume/2c4aeca6-bdf6-455e-ac76-4eeb4a408fa4/node_modules/better-sqlite3/addon-build/release/install-root/better_sqlite3.node
 → /rbd/pnpm-volume/2c4aeca6-bdf6-455e-ac76-4eeb4a408fa4/node_modules/better-sqlite3/addon-build/debug/install-root/better_sqlite3.node
 → /rbd/pnpm-volume/2c4aeca6-bdf6-455e-ac76-4eeb4a408fa4/node_modules/better-sqlite3/addon-build/default/install-root/better_sqlite3.node
 → /rbd/pnpm-volume/2c4aeca6-bdf6-455e-ac76-4eeb4a408fa4/node_modules/better-sqlite3/lib/binding/node-v93-linux-x64/better_sqlite3.node
    at bindings (/rbd/pnpm-volume/2c4aeca6-bdf6-455e-ac76-4eeb4a408fa4/node_modules/bindings/bindings.js:126:9)
    at Object.<anonymous> (/rbd/pnpm-volume/2c4aeca6-bdf6-455e-ac76-4eeb4a408fa4/node_modules/better-sqlite3/lib/database.js:9:24)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:94:18)
    at Object.<anonymous> (/rbd/pnpm-volume/2c4aeca6-bdf6-455e-ac76-4eeb4a408fa4/node_modules/better-sqlite3/lib/index.js:2:18)
    at Module._compile (node:internal/modules/cjs/loader:1101:14) {
  tries: [
    '/rbd/pnpm-volume/2c4aeca6-bdf6-455e-ac76-4eeb4a408fa4/node_modules/better-sqlite3/build/better_sqlite3.node',
    '/rbd/pnpm-volume/2c4aeca6-bdf6-455e-ac76-4eeb4a408fa4/node_modules/better-sqlite3/build/Debug/better_sqlite3.node',
    '/rbd/pnpm-volume/2c4aeca6-bdf6-455e-ac76-4eeb4a408fa4/node_modules/better-sqlite3/build/Release/better_sqlite3.node',
    '/rbd/pnpm-volume/2c4aeca6-bdf6-455e-ac76-4eeb4a408fa4/node_modules/better-sqlite3/out/Debug/better_sqlite3.node',
    '/rbd/pnpm-volume/2c4aeca6-bdf6-455e-ac76-4eeb4a408fa4/node_modules/better-sqlite3/Debug/better_sqlite3.node',
    '/rbd/pnpm-volume/2c4aeca6-bdf6-455e-ac76-4eeb4a408fa4/node_modules/better-sqlite3/out/Release/better_sqlite3.node',
    '/rbd/pnpm-volume/2c4aeca6-bdf6-455e-ac76-4eeb4a408fa4/node_modules/better-sqlite3/Release/better_sqlite3.node',
    '/rbd/pnpm-volume/2c4aeca6-bdf6-455e-ac76-4eeb4a408fa4/node_modules/better-sqlite3/build/default/better_sqlite3.node',
    '/rbd/pnpm-volume/2c4aeca6-bdf6-455e-ac76-4eeb4a408fa4/node_modules/better-sqlite3/compiled/16.6.1/linux/x64/better_sqlite3.node',
    '/rbd/pnpm-volume/2c4aeca6-bdf6-455e-ac76-4eeb4a408fa4/node_modules/better-sqlite3/addon-build/release/install-root/better_sqlite3.node',
    '/rbd/pnpm-volume/2c4aeca6-bdf6-455e-ac76-4eeb4a408fa4/node_modules/better-sqlite3/addon-build/debug/install-root/better_sqlite3.node',
    '/rbd/pnpm-volume/2c4aeca6-bdf6-455e-ac76-4eeb4a408fa4/node_modules/better-sqlite3/addon-build/default/install-root/better_sqlite3.node',
    '/rbd/pnpm-volume/2c4aeca6-bdf6-455e-ac76-4eeb4a408fa4/node_modules/better-sqlite3/lib/binding/node-v93-linux-x64/better_sqlite3.node'
  ]
}

I mean here’s the thing, i’ve tried the rebuild command, i’ve tried enabling npm, it just won’t work and I don’t wanna spam by bumping threads.

Oh, it’s running node v16.6.1, npm 7.20.3 so it works with the latest d.js version

Hello,

I’ve found a possible work-around that was found by a previous Glitch user on a github issue concerning thee same problem you are having. You can find the comment with the workaround here.

Here the extract from the comment, I would advise you the read the other comments of the conversation I’ve linked in order to get a sense of what is happening if this workaround does not work.

i added

  "engines": {
    "node": "15.x",
    "python": "2.7",
    "node-gyp": "6.x"
  },

to my package.json file

like so
image

image

i just ran node. after the change

and there is a red icon in the package.json window install the 2 that pop up
image

i just ran node . i skipped the npm i step

1 Like

This helped a lot, tsym!

2 Likes

It looks like from the screenshot that this makes it use Node 10 instead of Node 16? Is that how this fixes it?