WiseLibs / better-sqlite3

The fastest and simplest library for SQLite3 in Node.js.
MIT License
5.23k stars 390 forks source link

Unable to install better-sqlite3 under node 20.10.0, unknown error #1142

Closed sahi1l closed 4 months ago

sahi1l commented 4 months ago

I've been using better-sqlite3 successfully on my webserver, but recently it broke, complaining about version mismatches. I tried wiping node_modules and reinstalling, but when I get to better-sqlite3 is stalls on reify:better-sqlite3: timing reifyNode:node_modules/tar-stream/node_modules/readable-stream Completed in 444ms and then responds with

npm ERR! syscall write
npm ERR! errno -70
npm ERR! UNKNOWN: unknown error, write

npm ERR! A complete log of this run can be found in: /home/private/.npm/_logs/2024-02-13T18_53_47_301Z-debug-0.log

For some reason, that log file is not actually being written. (Probably a problem on my end?)

I only get this problem on my server, which has npm v10.2.5 and node v20.10.0. On my laptop, which has npm v10.1.0 and node v20.7.0, it works fine. In both cases, my package.json file is asking for "better-sqlite3": "^9.0.0" as a dependency.

I'm a node newbie so apologies if there is an obvious fix.

neoxpert commented 4 months ago

Have you tried a more recent version or the latest one instead of 9.0.0? I'm asking, because there is no prebuilt binary available of better-sqlite3 for Node 20. That means, that it has to be recompiled on install and I guess that's what failing on your server.

sahi1l commented 4 months ago

Ah, that was the problem. A newbie mistake; I thought "^9.0.0" meant "anything higher than 9.0.0" instead of "any minor release after 9.0.0". Thanks!

sahi1l commented 4 months ago

(Closing now)