<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/npm-12-released-install-scripts-off-by-default-as-registry-moves-to-explicit-trust-028uqbv4s" -->

---
title: npm 12 Released: Install Scripts Off by Default as...
description: npm 12 flips three install-time behaviors from opt-out to opt-in: allowScripts now defaults off (blocking preinstall/install/postinstall scripts and implicit...
canonical: https://daily.dev/posts/npm-12-released-install-scripts-off-by-default-as-registry-moves-to-explicit-trust-028uqbv4s
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: npm 12 Released: Install Scripts Off by Default as Registry Moves to Explicit Trust | daily.dev
og:description: npm 12 flips three install-time behaviors from opt-out to opt-in: allowScripts now defaults off (blocking preinstall/install/postinstall scripts and implicit...
og:url: https://daily.dev/posts/npm-12-released-install-scripts-off-by-default-as-registry-moves-to-explicit-trust-028uqbv4s
og:image: https://api.daily.dev/og/posts/028uqBV4S.png
og:image:alt: npm 12 Released: Install Scripts Off by Default as Registry Moves to Explicit Trust
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# npm 12 Released: Install Scripts Off by Default as Registry Moves to Explicit Trust

**[InfoQ](https://daily.dev/sources/infoq)** · 4 min read · 52 upvotes · 6 comments

## Summary

npm 12 flips three install-time behaviors from opt-out to opt-in: allowScripts now defaults off (blocking preinstall/install/postinstall scripts and implicit node-gyp builds), --allow-git defaults to none (closing a code execution path via a dependency's own .npmrc overriding the Git executable), and --allow-remote defaults to none (blocking https tarball dependencies). Teams had warnings since npm 11.16.0 to prepare, and GitHub's migration guide recommends allowing what's already installed before tightening further. Global installs and npx need config-based allowlisting instead of approve-scripts. Community reaction is largely positive, though some flag approval fatigue and an allowlist with no dependency scope as risks; JFrog reports these three vectors were involved in roughly 53% of malicious npm attacks over the past year. npm is the last major package manager (after pnpm, yarn, and bun) to adopt this kind of script-execution control.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.infoq.com/news/2026/08/npm-12-released>

## Questions this post answers

### why did my npm install stop running postinstall scripts after upgrading to npm 12

npm 12 changed allowScripts to default to off, so preinstall, install, and postinstall scripts from dependencies no longer run automatically, including implicit node-gyp builds for packages with a binding.gyp file. Developers must explicitly approve scripts using npm approve-scripts and commit the resulting allowlist to package.json, or the install silently skips them.

_daily.dev helps developers stay ahead of breaking npm changes like this before they hit a CI pipeline._

### how do I fix npm blocking git and remote tarball dependencies in npm 12

npm 12 changed --allow-git and --allow-remote to default to none, so Git dependencies and https tarball dependencies are blocked unless explicitly allowed. The Git change also closes a code execution path where a Git dependency's own .npmrc file could override the Git executable even with --ignore-scripts set. Use the allow-scripts config or approve-scripts command to permit specific packages.

_track dependency-breaking changes like this so migrating npm projects doesn't turn into guesswork._

### what percentage of malicious npm attacks relied on install scripts or non-registry sources

Roughly 53% of malicious npm attacks observed over the past year involved install scripts, Git dependencies, or remote tarball sources, according to JFrog's analysis. This is why npm 12 makes all three vectors opt-in by default rather than automatic, following similar controls already present in pnpm, yarn, and bun.

_developers evaluating package manager security tradeoffs can follow findings like this on daily.dev._

## Community discussion

Top comments from developers on daily.dev.

**@agustinbarrientos** · 2 upvotes

> Install-script permission changes should get their own line in a PR. Setup output is too easy to skim past

**@vladsiu** · 2 upvotes

> Finally some security stuff released

**@allinonetools** · 2 upvotes

> This is a solid security improvement. Disabling install scripts by default should make supply-chain attacks much harder without removing the flexibility teams actually need.

**@ajaychoudhary80** · 2 upvotes

> More secure defaults are always welcome—especially for dependency install scripts.

**@petermrozek** · 1 upvotes

> So, if I understand correctly, the only way to enable it is on the user side? What could go wrong? Now that agents run more and more build processes? Clearly no one will try to inject commands into the pipeline to enable and rebuild, right? 😉
>
> As long as there's ANY means of running a command during dependency installation, it's just a matter of time before the next Shai-Hulud type of attack happens. Any centralized repo that allows that is constantly vulnerable, be it NPM, Cargo or others.
>
> If you do need running commands, at the very least start pinning versions to specific tags or commit...

## Similar posts on daily.dev

- [npm v12 Ships With Install Scripts Off by Default, Begins De...](https://daily.dev/posts/npm-v12-ships-with-install-scripts-off-by-default-begins-de--mrvcfgl6f) · Socket · 1 upvotes · 0 comments
- [GitHub finally pulls the plug on automatic install script execution for npm](https://daily.dev/posts/github-finally-pulls-the-plug-on-automatic-install-script-execution-for-npm-lq84iidjt) · InfoWorld · 1 upvotes · 0 comments
- [npm v12’s Biggest Security Change: From Implicit to Explicit Trust](https://daily.dev/posts/npm-v12-s-biggest-security-change-from-implicit-to-explicit-trust-2d4pdcf9o) · JFrog · 0 upvotes · 0 comments

---

Tags: [#security](https://daily.dev/tags/security), [#javascript](https://daily.dev/tags/javascript), [#nodejs](https://daily.dev/tags/nodejs), [#npm](https://daily.dev/tags/npm)

[View this post on daily.dev](https://daily.dev/posts/npm-12-released-install-scripts-off-by-default-as-registry-moves-to-explicit-trust-028uqbv4s)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"npm 12 Released: Install Scripts Off by Default as Registry Moves to Explicit Trust","url":"https://daily.dev/posts/npm-12-released-install-scripts-off-by-default-as-registry-moves-to-explicit-trust-028uqbv4s","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/npm-12-released-install-scripts-off-by-default-as-registry-moves-to-explicit-trust-028uqbv4s"},"datePublished":"2026-08-14T06:40:54.859Z","dateModified":"2026-09-14T08:36:23.321Z","description":"npm 12 flips three install-time behaviors from opt-out to opt-in: allowScripts now defaults off (blocking preinstall/install/postinstall scripts and implicit...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/761cc0c028007021e1b366dd25b21aa4?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/761cc0c028007021e1b366dd25b21aa4?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"InfoQ","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"InfoQ","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/afc3bced3e1e4b188dd9127017a60e0c","url":"https://daily.dev/sources/infoq"},"commentCount":6,"discussionUrl":"https://daily.dev/posts/npm-12-released-install-scripts-off-by-default-as-registry-moves-to-explicit-trust-028uqbv4s","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":52},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":6}],"keywords":"security,javascript,nodejs,npm","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"InfoQ","item":"https://daily.dev/sources/infoq"},{"@type":"ListItem","position":3,"name":"npm 12 Released: Install Scripts Off by Default as Registry Moves to Explicit Trust"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/npm-12-released-install-scripts-off-by-default-as-registry-moves-to-explicit-trust-028uqbv4s","comment":[{"@type":"Comment","text":"Install-script permission changes should get their own line in a PR. Setup output is too easy to skim past","datePublished":"2026-08-16T03:12:43.210Z","url":"https://daily.dev/posts/028uqBV4S#c-271HXO18e","author":{"@type":"Person","name":"Agustin Barrientos","url":"https://daily.dev/agustinbarrientos","image":"https://media.daily.dev/image/upload/s--5ayxQnqn--/f_auto/v1788281802/avatars/avatar_wQYYVe5Tbj0NJ7C7qPoa8?_a=BAMAMicg0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2}},{"@type":"Comment","text":"Finally some security stuff released","datePublished":"2026-08-16T07:28:45.168Z","url":"https://daily.dev/posts/028uqBV4S#c-e4ew8Qe9M","author":{"@type":"Person","name":"Vladislav Siumbeli","url":"https://daily.dev/vladsiu","image":"https://media.daily.dev/image/upload/s--GalxSgjS--/f_auto/v1757768087/avatars/avatar_ezH33Lu6a37KM1SfsCwIx?_a=BAMClqZW0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2}},{"@type":"Comment","text":"This is a solid security improvement. Disabling install scripts by default should make supply-chain attacks much harder without removing the flexibility teams actually need.","datePublished":"2026-08-16T02:44:12.245Z","url":"https://daily.dev/posts/028uqBV4S#c-rZl6oaQBf","author":{"@type":"Person","name":"AllInOneTools","url":"https://daily.dev/allinonetools","image":"https://media.daily.dev/image/upload/s--4ZT8QlF0--/f_auto/v1769790028/avatars/avatar_igzBsWloJeaegzm9bQltZ?_a=BAMAMiiu0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2}},{"@type":"Comment","text":"More secure defaults are always welcome—especially for dependency install scripts.","datePublished":"2026-08-18T05:07:01.416Z","url":"https://daily.dev/posts/028uqBV4S#c-6A8XTqPmL","author":{"@type":"Person","name":"Ajay Choudhary","url":"https://daily.dev/ajaychoudhary80","image":"https://media.daily.dev/image/upload/s--WkX8wDW2--/f_auto/v1780989706/avatars/avatar_QNZlI2SgVnNSx5PSRpCVx?_a=BAMAMiWQ0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2}},{"@type":"Comment","text":"So, if I understand correctly, the only way to enable it is on the user side? What could go wrong? Now that agents run more and more build processes? Clearly no one will try to inject commands into the pipeline to enable and rebuild, right? 😉\nAs long as there’s ANY means of running a command during dependency installation, it’s just a matter of time before the next Shai-Hulud type of attack happens. Any centralized repo that allows that is constantly vulnerable, be it NPM, Cargo or others.\nIf you do need running commands, at the very least start pinning versions to specific tags or commit IDs. Those are significantly harder to override. Semver with automatic (even minor version) upgrades and command running is the obvious attack vector at this point.","datePublished":"2026-08-15T08:36:58.215Z","dateModified":"2026-08-15T08:37:13.728Z","url":"https://daily.dev/posts/028uqBV4S#c-LmUxEG5cp","author":{"@type":"Person","name":"Peter Mrożek","url":"https://daily.dev/petermrozek","image":"https://media.daily.dev/image/upload/s--pBfYX68K--/f_auto/v1769247960/avatars/avatar_Qz65P1nVw3Bu6C5YwaZgA?_a=BAMAMiiu0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/npm-12-released-install-scripts-off-by-default-as-registry-moves-to-explicit-trust-028uqbv4s#faq","mainEntity":[{"@type":"Question","name":"why did my npm install stop running postinstall scripts after upgrading to npm 12","acceptedAnswer":{"@type":"Answer","text":"npm 12 changed allowScripts to default to off, so preinstall, install, and postinstall scripts from dependencies no longer run automatically, including implicit node-gyp builds for packages with a binding.gyp file. Developers must explicitly approve scripts using npm approve-scripts and commit the resulting allowlist to package.json, or the install silently skips them. daily.dev helps developers stay ahead of breaking npm changes like this before they hit a CI pipeline."}},{"@type":"Question","name":"how do I fix npm blocking git and remote tarball dependencies in npm 12","acceptedAnswer":{"@type":"Answer","text":"npm 12 changed --allow-git and --allow-remote to default to none, so Git dependencies and https tarball dependencies are blocked unless explicitly allowed. The Git change also closes a code execution path where a Git dependency's own .npmrc file could override the Git executable even with --ignore-scripts set. Use the allow-scripts config or approve-scripts command to permit specific packages. track dependency-breaking changes like this so migrating npm projects doesn't turn into guesswork."}},{"@type":"Question","name":"what percentage of malicious npm attacks relied on install scripts or non-registry sources","acceptedAnswer":{"@type":"Answer","text":"Roughly 53% of malicious npm attacks observed over the past year involved install scripts, Git dependencies, or remote tarball sources, according to JFrog's analysis. This is why npm 12 makes all three vectors opt-in by default rather than automatic, following similar controls already present in pnpm, yarn, and bun. developers evaluating package manager security tradeoffs can follow findings like this on daily.dev."}}]}
```

