Skip to content

build(npm): allowlist dependency install scripts - #112

Merged
caugner merged 2 commits into
mainfrom
fred-1868-npm-v12-forward-compat
Sep 9, 2026
Merged

build(npm): allowlist dependency install scripts#112
caugner merged 2 commits into
mainfrom
fred-1868-npm-v12-forward-compat

Conversation

@caugner

@caugner caugner commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Description

Add an allowScripts entry denying fsevents, the only dependency flagged as having an install script.

Motivation

npm 11.16+ warns on every install about fsevents, the only dependency flagged as having an install script, and npm 12 blocks it. The published tarball has no install script (only the registry manifest lists one), so the entry records an explicit false.

Additional details

  • fsevents is darwin-only, so Ubuntu CI never installs it and does not exercise the entry.
  • Strict mode is not enabled: .nvmrc pins Node 22, whose npm does not know the option.
  • Verified: npm ci --strict-allow-scripts passes on npm 12.0.2 and 11.19.0; npm approve-scripts --allow-scripts-pending reports nothing.

Related issues and pull requests

Part of mdn/fred#1868.

npm 12 no longer runs `preinstall`/`install`/`postinstall` from
dependencies unless the root `package.json` lists them in `allowScripts`.
`npm ci` still succeeds, so a missing entry only surfaces later as a
missing binary.

Generated with `npm approve-scripts --all --no-allow-scripts-pin`, so the
entries are name-only and keep matching after a dependency bump.
The published fsevents 2.3.3 tarball ships a prebuilt `fsevents.node`
and has no `install` script; only the registry manifest marks it as
having one, so approving it grants nothing useful.
@caugner
caugner marked this pull request as ready for review September 8, 2026 16:40
@caugner
caugner requested review from a team and mdn-bot as code owners September 8, 2026 16:40
@caugner
caugner requested a review from pepelsbey September 8, 2026 16:40

@pepelsbey pepelsbey left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thank you 🙂

@caugner
caugner merged commit 2b556c7 into main Sep 9, 2026
7 checks passed
@caugner
caugner deleted the fred-1868-npm-v12-forward-compat branch September 9, 2026 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants