Use pnpm
as our frontend dependency manager¶
Context and Problem Statement¶
In our frontend projects, we need a reliable, efficient, and developer-friendly package manager for JavaScript/TypeScript dependencies.
Key concerns include:
- Speed and disk usage efficiency.
- Deterministic and reproducible installs.
- Compatibility with existing tools and workflows.
- Minimizing node_modules bloat and install conflicts.
Considered Options¶
- npm
- yarn (classic or berry)
- pnpm
Options not considered: package managers used by runtimes other than NodeJS, such as Deno or Bun.
Decision Outcome¶
- pnpm was selected as our default package manager due to its performance benefits, disk space efficiency, and strict dependency resolution.
- Compared to npm and yarn, pnpm uses a content-addressable storage system and hard links to avoid duplication.
- It also enforces more consistent dependency resolution, helping to catch errors early in development.
Consequences¶
- ✅ Fast install speeds, especially in CI environments.
- ✅ Reduced disk usage thanks to shared dependency storage.
- ✅ More deterministic builds with stricter dependency isolation.
- ❌ Less familiar for some contributors compared to npm/yarn.
- ❌ Occasional compatibility issues with legacy packages expecting a flat node_modules.