better-sqlite3 icon indicating copy to clipboard operation
better-sqlite3 copied to clipboard

Installation problems with call to https://unofficial-builds.nodejs.

Open richarda23 opened this issue 4 months ago • 1 comments

Hello Great library thank you

I am trying to use better-sqlite3 v12 in a node.js webapp, built as Docker container on node-alpine:22 base image. All is fine on local dev but when installing in Ci/CD, installation of better-sqlite attempts to make a call to https://unofficial-builds.nodejs.

This URL is blocked by our employer policies and after reading the docs for unofficial-builds.nodejs.org (minimal testing, no guarantees etc) it's unlikely to get allowed...

Is there a workaround for using better-sqlite3 that doesn't need to install an unofficial node package?

Here is the relevant log output:

#15 30.51 .../node_modules/better-sqlite3 install: gyp http GET https://unofficial-builds.nodejs.org/download/release/v22.19.0/node-v22.19.0-headers.tar.gz

Thank you - realise the immediate issue is a networking one rather than a bug in better-sqlite3 itself, but any advice on a workaround greatly appreciated, thanks

richarda23 avatar Aug 30 '25 12:08 richarda23

This does not come from better-sqlite3 but rather node-gyp. Which is only executed when no prebuild binary was found to build the addon locally.

Prebuilds should be available, please share the full logs or a minimal Dockerfile to reproduce the behavior.

I can npm i better-sqlite3 inside node:22-alpine without compilation needed.

Prinzhorn avatar Sep 01 '25 06:09 Prinzhorn