Skip to content

[BUG] Incorrect detection of install script for better-sqlite3@13.0.2? #9837

Description

@achou11

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

This is not just a request to bump a dependency for a CVE

  • This is not solely a request to bump a dependency for a CVE

Current Behavior

I'm seeing an unexpected warning about a better-sqlite@13.0.2 having an install script.

added 2 packages, and audited 3 packages in 342ms

found 0 vulnerabilities
npm warn install-scripts 1 package had install scripts blocked because they are not covered by allowScripts:
npm warn install-scripts   better-sqlite3@13.0.2 (install: node-gyp rebuild)
npm warn install-scripts
npm warn install-scripts Run `npm install-scripts ls` to review, or `npm install-scripts approve <pkg>` to allow.

Expected Behavior

While better-sqlite3 uses node-gyp, the automatic creation of an install script when publishing is disabled by the inclusion of the gypfile: false option in its package.json. See WiseLibs/better-sqlite3#1503 and WiseLibs/better-sqlite3#1505.

I'm not seeing any indication of an install script for this version of better-sqlite3 in the packument API response: https://registry.npmjs.com/better-sqlite3.

The expectation is that there's no warning at all when installing better-sqlite3@13.0.2.

Steps To Reproduce

Create a project with the following package.json:

{
  "type": "module",
  "dependencies": {
    "better-sqlite3": "13.0.2"
  }
}

Run npm install

Environment

  • npm: 12.0.2
  • Node.js: 24.18.0
  • OS Name: macOS 26.5.2 (Tahoe)
  • System Model Name: MacBook Air M5
  • npm config:
; node bin location = /Users/andrewchou/.local/share/mise/installs/node/24.18.0/bin/node
; node version = v24.18.0
; npm local prefix = /Users/andrewchou/code/github/achou11/npm-allow-scripts-issue-repro
; npm version = 12.0.2
; cwd = /Users/andrewchou/code/github/achou11/npm-allow-scripts-issue-repro
; HOME = /Users/andrewchou
; Run `npm config ls -l` to show all defaults

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions