Practical tools to prepare your project for npm v12's breaking changes. Full guide at npmv12guide.com.
# 1. Upgrade to npm 11.16.0+ (shows v12 warnings)
npm install -g npm@11
# 2. Scan your project for v12 issues
chmod +x scan-v12.sh
./scan-v12.sh
# 3. See what scripts will be blocked
npm approve-scripts --allow-scripts-pending
# 4. Approve trusted packages
npm approve-scripts bcrypt sharp node-gyp
# 5. Commit the allowlist
git add package.json && git commit -m "chore: add npm v12 allowScripts allowlist"| File | What it does |
|---|---|
scan-v12.sh |
Audits a project for npm v12 readiness — finds native deps, Git deps, shrinkwrap files, and npm view usage in CI scripts |
.npmrc.example |
Minimal .npmrc config for npm v12 with comments explaining each option |
package.json.example |
Example package.json with the allowScripts field format |
ci-github-actions.example.yml |
GitHub Actions CI config that works with npm v12 |
MIT — same as the npm CLI.