#9982·npm

[BUG] Workspace lifecycle scripts silently skipped under `install-strategy=linked`

Author: manzoorwanijkCreated Sep 15, 2026Updated Sep 15, 2026
LabelsBugNeeds Triage

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

With install-strategy=linked, npm install does not run a workspace's preinstall, install, postinstall or prepare scripts. Nothing is logged, the unreviewed scripts advisory does not list the workspace, and --strict-allow-scripts still exits 0. Hoisted on npm 12 and linked on npm 11.19.1 run all four.

Expected Behavior

Workspace scripts run under linked, as they do under hoisted, since workspaces are exempt from the allowScripts gate.

Steps To Reproduce

bash
mkdir x && cd x
mkdir -p packages/a
echo '{"name":"r","version":"1.0.0","workspaces":["packages/*"]}' > package.json
echo '{"name":"a","version":"1.0.0","scripts":{"postinstall":"touch post.txt","prepare":"touch prepared.txt"}}' > packages/a/package.json
npm install --install-strategy=linked --no-audit --no-fund
ls packages/a   # expected: package.json post.txt prepared.txt, actual: package.json

Environment

  • npm: 12.0.2 and latest (c9876d7ea)
  • Node.js: v24.18.0
  • OS Name: macOS Darwin 25.6.0