v13.0.3: gypfile:false does not prevent node-gyp/Python invocation on Windows (npm ci)

Author: JohannesGuetlingCreated Aug 20, 2026Updated Sep 21, 2026

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

  1. Remove node_modules and package-lock.json to ensure a clean state:

    powershell
    Remove-Item -Recurse -Force node_modules, package-lock.json -ErrorAction SilentlyContinue  
  2. Install the package directly:

    powershell
    npm.cmd install [email protected]  

    (Same result also occurs with npm.cmd ci --omit=dev against 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:

bash
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_source is 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-install mechanism, without requiring Python.
  • This appears to confirm that gypfile: false alone is not sufficient to stop npm's implicit node-gyp rebuild behavior on Windows when no explicit install script is present - matching the root cause originally described in #1503.

Related: #1503, #1505