<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/npm-s-defaults-are-bad-2fqdhx40i" -->

---
title: npm's Defaults Are Bad | daily.dev
description: npm's default settings are a root cause of JavaScript's recurring supply chain security problems. Key issues include: npm install silently rewriting lockfiles...
canonical: https://daily.dev/posts/npm-s-defaults-are-bad-2fqdhx40i
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: npm's Defaults Are Bad | daily.dev
og:description: npm's default settings are a root cause of JavaScript's recurring supply chain security problems. Key issues include: npm install silently rewriting lockfiles...
og:url: https://daily.dev/posts/npm-s-defaults-are-bad-2fqdhx40i
og:image: https://api.daily.dev/og/posts/2fqDhX40I.png
og:image:alt: npm's Defaults Are Bad
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's Defaults Are Bad

**[Andrew Nesbitt](https://daily.dev/sources/nesbitt-io)** · 6 min read · 21 upvotes · 2 comments

## Summary

npm's default settings are a root cause of JavaScript's recurring supply chain security problems. Key issues include: npm install silently rewriting lockfiles (npm ci is safer but obscure), postinstall scripts running by default for all packages (pnpm v10 and Bun block these by default), trusted publishing being reversible rather than a one-way door, the min-release-age cooldown feature being opt-in rather than default, and npx having no lockfile or cooldown at all. The axios compromise — 83M weekly downloads, malicious versions live for 2-3 hours via a staged dependency — illustrates exactly how these defaults are exploited. While pnpm, Bun, and Deno have made better security choices, npm ships with Node.js and dominates actual usage, making its defaults the baseline for millions of projects. Changing npm's defaults would do more for JavaScript supply chain security than any scanner or post-incident review.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://nesbitt.io/2026/03/31/npms-defaults-are-bad.html>

## Community discussion

Top comments from developers on daily.dev.

**@alvarogfn** · 0 upvotes

> It really is a major issue. Even if npm is fixed in a recent release, most people still use older versions and, even worse, many projects depend on these insecurities to function.

**@ravavyr** · 0 upvotes

> To be fair... all defaults are "bad" from a security pov  :)

## Similar posts on daily.dev

- [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
- [Why npm dependencies are a bigger security risk than your code](https://daily.dev/posts/why-npm-dependencies-are-a-bigger-security-risk-than-your-code-zyi7hulam) · LogRocket · 0 upvotes · 0 comments

---

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

[View this post on daily.dev](https://daily.dev/posts/npm-s-defaults-are-bad-2fqdhx40i)

```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's Defaults Are Bad","url":"https://daily.dev/posts/npm-s-defaults-are-bad-2fqdhx40i","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/npm-s-defaults-are-bad-2fqdhx40i"},"datePublished":"2026-03-31T15:54:04.994Z","dateModified":"2026-03-31T15:54:31.898Z","description":"npm's default settings are a root cause of JavaScript's recurring supply chain security problems. Key issues include: npm install silently rewriting lockfiles...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/416572ca2b211e96c4c4b92af22d1ec7?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/416572ca2b211e96c4c4b92af22d1ec7?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Andrew Nesbitt","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":"Andrew Nesbitt","logo":"https://media.daily.dev/image/upload/logos/placeholder.jpg","url":"https://daily.dev/sources/nesbitt-io"},"commentCount":2,"discussionUrl":"https://daily.dev/posts/npm-s-defaults-are-bad-2fqdhx40i","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":21},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":2}],"keywords":"security,javascript,npm","timeRequired":"PT6M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Andrew Nesbitt","item":"https://daily.dev/sources/nesbitt-io"},{"@type":"ListItem","position":3,"name":"npm's Defaults Are Bad"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/npm-s-defaults-are-bad-2fqdhx40i","comment":[{"@type":"Comment","text":"It really is a major issue. Even if npm is fixed in a recent release, most people still use older versions and, even worse, many projects depend on these insecurities to function.","datePublished":"2026-04-01T06:46:33.474Z","url":"https://daily.dev/posts/2fqDhX40I#c-taZNhZ7Zv","author":{"@type":"Person","name":"Álvaro Guimarães","url":"https://daily.dev/alvarogfn","image":"https://avatars.githubusercontent.com/u/62889807?v=4"}},{"@type":"Comment","text":"To be fair… all defaults are “bad” from a security pov  :)","datePublished":"2026-04-08T15:12:07.440Z","url":"https://daily.dev/posts/2fqDhX40I#c-zKGbkKSAR","author":{"@type":"Person","name":"Ramsez Stamper","url":"https://daily.dev/ravavyr","image":"https://lh3.googleusercontent.com/a/AGNmyxYvk0A28pTmE32gmh59XDuOpMsFjjhwtMm6TiszOQ=s96-c"}}]}
```

