v13.0.3: gypfile:false does not prevent node-gyp/Python invocation on Windows (npm ci)
Description
After the fix in #1505 (gypfile: false added in v13.0.2), I expected npm install/npm ci to skip node-gyp rebuild on Windows when a prebuilt binary is bundled. However, on a clean install with no node_modules or package-lock.json present, [email protected] still invokes node-gyp rebuild, which fails because Python is not installed.
This reproduces the exact issue reported in #1503, even though that issue is closed as resolved.
Environment
- better-sqlite3: 13.0.3
- Node.js: v24.19.0
- npm: 11.17.0
- OS: Windows 11 Enterprise (10.0.26100), x64
- npm_config_build_from_source: undefined (confirmed not set)
Steps to reproduce
Remove
node_modulesandpackage-lock.jsonto ensure a clean state:Remove-Item -Recurse -Force node_modules, package-lock.json -ErrorAction SilentlyContinueInstall the package directly:
npm.cmd install [email protected](Same result also occurs with
npm.cmd ci --omit=devagainst a lockfile pinned to 13.0.3.)
Expected behavior
Since a prebuilds/win32-x64.node binary is bundled with the package and gypfile is set to false, npm should install the prebuilt binary directly without invoking node-gyp rebuild or requiring Python.
Actual behavior
Installation still runs node-gyp rebuild and fails:
npm error command failed
npm error command C:\WINDOWS\system32\cmd.exe /d /s /c node-gyp rebuild
...
npm error gyp ERR! find Python
npm error gyp ERR! find Python **********************************************************
npm error gyp ERR! find Python You need to install the latest version of Python.
...
npm error gyp ERR! configure error
npm error gyp ERR! stack Error: Could not find any Python installation to use
...
npm error gyp ERR! $npm_package_name better-sqlite3
npm error gyp ERR! $npm_package_version 13.0.3
npm error gyp ERR! not ok Full debug log:
2026-08-20T08_53_55_394Z-debug-0.log
Additional notes
- I confirmed
npm_config_build_from_sourceis not set globally, in project.npmrc, or as an environment variable, so this is not a local config override forcing a source build. - v12.11.1 installs cleanly on the same machine using the bundled
prebuild-installmechanism, without requiring Python. - This appears to confirm that
gypfile: falsealone is not sufficient to stop npm's implicitnode-gyp rebuildbehavior on Windows when no explicitinstallscript is present - matching the root cause originally described in #1503.
Related: #1503, #1505
Source: WiseLibs/better-sqlite3