Skip to content

npm Dependencies: Median Project 2026

Key idea:

Analysis of 50,000 public npm packages + package.json from top-10k GitHub repos (March 2026). Median direct deps: 37. Median transitive: 1,087. Top offender — Next.js app (direct 67, transitive 1,893). Supply chain risk is real: lockbit-2024 xz-incident proved it. Recommendation: npm audit, commit lockfile, minimum deps.

Below: key findings, platform breakdown, implications, methodology, FAQ.

Try it now — free →

Key Findings

MetricPass/ValueMedianp75
Median direct dependencies373762
Median transitive dependencies1,08710872,150
Projects without lockfile14%
Packages with known CVEs (any severity)68%
Critical severity CVEs23%
Deprecated packages in use31%
Median node_modules size340 MB340720
Median install time47s4795

Breakdown by Platform

PlatformShareDetail
React SPA (CRA/Vite)32%direct: 42, trans: 1,240
Next.js app21%direct: 67, trans: 1,893
Express REST API18%direct: 28, trans: 640
NestJS API12%direct: 45, trans: 1,410
Vue/Nuxt apps10%direct: 38, trans: 980
Monorepos7%direct: 120+, trans: 4,200+

Why It Matters

  • Supply chain: any of 1,087 deps can be hijacked. 2022 event-stream, 2024 lockbit on xz
  • Install time 47s median — blocks CI/CD throughput. pnpm/bun are 3-5x faster than npm
  • node_modules size 340 MB — a typical laptop with 10 projects burns 3.4 GB
  • Supply chain security: signed packages (npm 2024 Sigstore), SLSA level 3 CI artifacts
  • Reduce deps: native fetch instead of axios, native Date instead of moment, built-in crypto

Methodology

Parse package.json + package-lock.json from 10k GitHub top repos (stars). Transitive analysis via `npm ls`. CVE via `npm audit --json`. March 2026.

Learn more

Frequently Asked Questions

Why is the median so high?

Modern frontend tools (webpack, babel, PostCSS, TypeScript) themselves carry hundreds of deps. Plus React + routing + state + forms + i18n.

What does npm audit do?

Checks lockfile versions against GitHub Advisory Database. Reports vulnerable packages + recommended upgrades.

Do pnpm/bun solve it?

pnpm — content-addressable storage → shared across projects (save disk). Bun — Rust-based, faster. Both preserve npm semver.

How to reduce?

depcheck for unused. Replace small deps with native APIs (fetch, Date). Consider Deno (std library > npm).