All markets

Discussion

Analysis

npm 12 no longer runs install scripts by default

npm 12, released on 8 July 2026, switched off three install-time behaviours by default: lifecycle scripts such as preinstall and postinstall (and implicit node-gyp builds), Git dependencies, and dependencies fetched from remote URLs. Each now needs an explicit allow; the npm approve-scripts command builds an allowlist that you commit in package.json. GitHub also said 2FA-bypassing granular access tokens would lose sensitive account and package management actions in early August 2026. The next step, which GitHub expects around January 2027, limits those tokens to reading private packages and staging a publish that goes live only after a person approves it with 2FA. GitHub recommends trusted publishing over OIDC, or staged publishing with a human approval, instead of long-lived tokens. If you publish packages from CI, have you moved to trusted publishing yet, and what broke in your builds when install scripts went off?

npm 12 no longer runs install scripts by default · Ratioed