-
-
Couldn't load subscription status.
- Fork 429
Open
Description
- Building
better-sqlite3@12.3.0on Node.js 25.0.0 fails becauseutil/macros.cppis not found during the native compilation step. - Although Node 25 is not yet listed as officially supported, the widespread use of
node:latest(which switched to 25 on 2025-10-15) means many projects will encounter this failure
Reproduction Steps
-
Copy the following Dockerfile into your workspace
ARG NODE_VERSION=24 FROM node:${NODE_VERSION} WORKDIR /app RUN cat <<'EOF' > package.json { "name": "better-sqlite3-node-repro", "version": "1.0.0", "private": true, "type": "module", "dependencies": { "better-sqlite3": "12.3.0" } } EOF RUN npm install --package-lock-only RUN npm ci
-
Build with Node 24 (succeeds):
docker build --no-cache --progress=plain -t repro-node24 --build-arg NODE_VERSION=24 . -
Build with Node 25 (fails):
docker build --no-cache --progress=plain -t repro-node25 --build-arg NODE_VERSION=25 .
Expected Result
npm cishould complete successfully for both Node 24 and Node 25.
Actual Result (Node 25)
npm ciexits withnode-gyperrorfatal error: util/macros.cpp: No such file or directory.
Key Portion of the Failing Output
npm warn EBADENGINE Unsupported engine { package: 'better-sqlite3@12.3.0', required: { node: '20.x || 22.x || 23.x || 24.x' }, current: { node: 'v25.0.0', npm: '11.6.2' } }
...
../src/better_sqlite3.cpp:21:10: fatal error: util/macros.cpp: No such file or directory
21 | #include "util/macros.cpp"
| ^~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [better_sqlite3.target.mk:122: Release/obj.target/better_sqlite3/src/better_sqlite3.o] Error 1
npm ERR! gyp ERR! build error
Pnlvfx and GreyXor
Metadata
Metadata
Assignees
Labels
No labels