Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    npm 12 Install Scripts Fix: Approve Only the Packages That Must Run

    1

    Fixes installs broken by npm 12's blocked install scripts and git/URL dependencies with a tested, minimal allowScripts policy and a pass/fail report.

    $1

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    npm 12 Install Scripts Fix: Approve Only the Packages That Must Run

    npm 12 Install Scripts Fix: Approve Only the Packages That Must Run

    Example session with this skill installed

    We moved CI to npm 12 and now require('bcrypt') fails with "Cannot find module". The project uses esbuild, bcrypt, sharp, lodash and husky. Fix the install policy without just allowing everything.

    • Read your context and instructions
    • Compiled the npm 12 install

    npm 12 install-policy report: demo-app

    Date: 2026-11-05 · npm 12 · Node 22 · Platforms tested: Linux x64

    Verdict

    PASS WITH EXCEPTIONS: 1 approval needed; macOS, Alpine and ARM not verified.

    Packages with install-time scripts

    Package@versionScriptClassWorks without script? (evidence)Decision
    bcrypt@5.1.1install: node-pre-gyp install --fallback-to-buildRequiredNo: require('bcrypt') → Cannot find module (native binding)npm approve-scripts bcrypt → "bcrypt@5.1.1": true
    esbuild@0.25.12postinstall: node install.jsOptionalYes: transformSync of TS succeededNo entry
    sharp@0.34.5install: node install/check.js || npm run buildOptionalYes: require('sharp') loadedNo entry

    Git / remote-URL dependencies

    None found.

    Verification

    CheckCommandResult
    Clean installrm -rf node_modules && npm cipass
    Pending approvalsnpm approve-scripts --allow-scripts-pendingnone
    Scannerpython3 scripts/scan_install_policy.py .exit 0
    bcrypt loads after rebuildnpm rebuild bcrypt && node -e "require('bcrypt')"pass

    Connects securely to your tools. The creator never sees your data.

    About this skill

    npm 12 (generally available since 8 July 2026) no longer runs dependency preinstall, install or postinstall scripts, or implicit node-gyp builds, unless the project allows them. It also refuses git dependencies and remote-URL tarballs by default. Installs still "succeed", so the breakage shows up later: a native addon fails to load, a binary is missing, a build step in CI or Docker breaks. This skill turns that into a short, checkable job: inventory every blocked item, prove which ones the project actually needs, write the smallest allowScripts policy that works, fix non-registry sources, and verify with a clean install. The result is a written report plus the exact package.json / .npmrc / CI changes.

    • Moving a project, CI runner or Docker image to npm 12 (or to npm 11.16+, which already warns).
    • "It worked yesterday": Cannot find module '.../build/Release/*.node', a missing binary, or a package that expects its postinstall to have run.
    • npm prints a list of packages whose install scripts were skipped.
    • npm install refuses a git+https://, github: or https://…/*.tgz dependency.
    • Hardening a repository after a supply-chain incident: you want install-time code execution limited to a reviewed list.

    Not for: pnpm, Yarn or Bun projects (they have their own approval models; see Pitfalls), or for auditing packages for CVEs.

    FactSource
    npm v12 is GA and tagged latest; allowScripts defaults to off; dependency preinstall/install/postinstall and implicit node-gyp builds don't run unless allowedGitHub changelog, 2026-07-08
    --allow-git and --allow-remote default to none in npm 12; --allow-file / --allow-directory defaults unchangedGitHub changelog, 2026-06-09; npm v12 config docs
    A package with binding.gyp and no install script is still blocked (implicit node-gyp rebuild); prepare scripts of git/file/link dependencies are blocked tooGitHub changelog, 2026-06-09
    Install commands skip unapproved scripts and end with a list of skipped packages; install does not fail by defaultnpm v12 approve-scripts docs; npm community discussion #198547
    npm approve-scripts <pkg> writes pinned pkg@x.y.z entries by default; --no-allow-scripts-pin writes name-only entries; --all approves everything pending; --allow-scripts-pending lists pending packages (read-only)npm v12 approve-scripts docs
    npm deny-scripts <pkg> writes name-only false entries; false always winsnpm v12 deny-scripts docs
    Both commands are "unaware of workspaces"npm v12 docs
    --allow-scripts=a,b is for npx, npm exec and npm install -g; passing it to a project-scoped install/ci/update/rebuild is an errornpm v12 config docs
    dangerously-allow-all-scripts bypasses the policy; --ignore-scripts still takes precedence; strict-allow-scripts turns skipped scripts into a failed installnpm v12 config docs

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Security.

    Covers npm only; pnpm, Yarn and Bun use different approval settings. Tests run on the agent's machine, so other operating systems and CPU architectures are reported as not verified rather than assumed. Some npm 12 behaviours were undocumented at the time of checking (root-project scripts, workspaces placement, which Node.js release bundles npm 12); the skill tells the agent to verify these on the user's npm version. The scanner treats version-range allowScripts keys conservatively (exact versions only) and may flag them for review.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 12 days ago

    Software
    Node.jsnpm 11.16+Python 3package.jsonpackage-lock.jsonGit

    npm 12 is needed for enforcement. Python runs the bundled scanner with the standard library.

    Permissions

    Allowed Hosts

    registry.npmjs.org (via npm, during installs only)

    File Scopes

    package.json
    package-lock.json
    node_modules/
    (read-only)
    .npmrc
    CI
    workflow
    files
    and
    Dockerfiles
    NPM12-INSTALL-POLICY.md
    (created)

    The bundled scanner is read-only and makes no network calls. Dependency scripts are never run before they are reviewed; installs start with --ignore-scripts.

    Listed12 days ago

    What's inside

    Frequently Asked Questions

    Since npm 12 became GA on 8 July 2026, dependency preinstall/install/postinstall scripts and implicit node-gyp builds no longer run unless listed in allowScripts, and git and remote-URL dependencies are refused unless allow-git/allow-remote say otherwise. Installs still finish, so failures appear later at runtime or build time.

    That re-opens the install-time code execution npm 12 closed. This skill tests each package with its script skipped and approves only the ones that genuinely fail without it. In our sample project, one of three packages needed approval.

    Every rule was checked against the GitHub changelog posts and the npm v12 docs on 5 November 2026, and the skill lists its sources with the date. Points the docs didn't cover at that time are labelled for the agent to verify instead of assume.

    No. Those package managers have their own approval settings. The skill names them so the agent doesn't apply npm's allowScripts where it has no effect.

    Vulnerability scanners look for known CVEs. This skill fixes the npm 12 install policy: which install scripts run, which git and URL sources are allowed, and what CI and Docker need. It produces a verified PASS/FAIL report.

    New in Security