Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

better-sqlite3 works under node20 but gives error under deno #1205

Open
bkerin opened this issue Jun 20, 2024 · 1 comment
Open

better-sqlite3 works under node20 but gives error under deno #1205

bkerin opened this issue Jun 20, 2024 · 1 comment

Comments

@bkerin
Copy link

bkerin commented Jun 20, 2024

I'm not sure if this is a better-sqlite3 issue or a deno issue but I thought it might be of interest and of course I'd be grateful for help.

With a minimal node20 test project this index.mjs run with node index.mjs after node install better-sqlite3 works as expected:

port sqlite from 'better-sqlite3'
const db = sqlite()
console.log(db)

while this near-equivalent test_better_sqlite3.js file run with deno run -A test_better_sqlite3.js fails (errors below):

import sqlite from "npm:better-sqlite3"
const db = sqlite()
console.log(db)

The error output is:

error: Uncaught (in promise) Error: Could not locate the bindings file. Tried:
 → /home/bkerin/.cache/deno/npm/registry.npmjs.org/bindings/1.5.0/build/better_sqlite3.node
 → /home/bkerin/.cache/deno/npm/registry.npmjs.org/bindings/1.5.0/build/Debug/better_sqlite3.node
 → /home/bkerin/.cache/deno/npm/registry.npmjs.org/bindings/1.5.0/build/Release/better_sqlite3.node
 → /home/bkerin/.cache/deno/npm/registry.npmjs.org/bindings/1.5.0/out/Debug/better_sqlite3.node
 → /home/bkerin/.cache/deno/npm/registry.npmjs.org/bindings/1.5.0/Debug/better_sqlite3.node
 → /home/bkerin/.cache/deno/npm/registry.npmjs.org/bindings/1.5.0/out/Release/better_sqlite3.node
 → /home/bkerin/.cache/deno/npm/registry.npmjs.org/bindings/1.5.0/Release/better_sqlite3.node
 → /home/bkerin/.cache/deno/npm/registry.npmjs.org/bindings/1.5.0/build/default/better_sqlite3.node
 → /home/bkerin/.cache/deno/npm/registry.npmjs.org/bindings/1.5.0/compiled/20.11.1/linux/x64/better_sqlite3.node
 → /home/bkerin/.cache/deno/npm/registry.npmjs.org/bindings/1.5.0/addon-build/release/install-root/better_sqlite3.node
 → /home/bkerin/.cache/deno/npm/registry.npmjs.org/bindings/1.5.0/addon-build/debug/install-root/better_sqlite3.node
 → /home/bkerin/.cache/deno/npm/registry.npmjs.org/bindings/1.5.0/addon-build/default/install-root/better_sqlite3.node
 → /home/bkerin/.cache/deno/npm/registry.npmjs.org/bindings/1.5.0/lib/binding/node-v108-linux-x64/better_sqlite3.node
    at bindings (file:///home/bkerin/.cache/deno/npm/registry.npmjs.org/bindings/1.5.0/bindings.js:126:9)
    at new Database (file:///home/bkerin/.cache/deno/npm/registry.npmjs.org/better-sqlite3/11.0.0/lib/database.js:48:64)
    at Database (file:///home/bkerin/.cache/deno/npm/registry.npmjs.org/better-sqlite3/11.0.0/lib/database.js:11:10)
    at file:///home/bkerin/projects/cell_electric_meter/web_server/test_better_sqlite3.js:3:12

Ideas?

@bkerin
Copy link
Author

bkerin commented Jun 20, 2024

Looks like I'm far from the first person to hit this but it appears to still not work as of deno 1.44.2

#1034

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant