Yarn
js package manager, compatible with the npm registry, that installs, manages, and locks project dependencies.
Definition
Yarn is a fast, reliable JavaScript and Node.js package manager, compatible with the npm registry, that installs, manages, and locks project dependencies.
Overview
Yarn was released in 2016 to address early npm shortcomings around install speed, determinism, and security, and has since become an independent, community-governed open-source project. It resolves and installs packages from the npm registry (or private registries), generating a yarn.lock file that guarantees deterministic installs across machines. It offers workspaces for managing monorepos, and in Yarn Berry (v2+) it supports Plug'n'Play resolution, which can skip the traditional node_modules folder entirely for faster installs. Yarn sits alongside npm and Bun as one of the main package manager choices in the Node.js ecosystem. It's frequently paired with monorepo tooling like Turborepo, and it commonly sits underneath bundlers such as Webpack or Vite as the dependency-installation layer of a project's build pipeline.
Key Features
- Deterministic installs via yarn.lock for consistent dependency trees
- Compatible with the npm package registry and package.json format
- Workspaces for managing multiple packages in a monorepo
- Offline caching for faster repeat installs
- Plug'n'Play (PnP) mode in Yarn Berry that can skip node_modules entirely
- Built-in support for constraints and dependency version enforcement
Use Cases
History
Yarn is a JavaScript package manager created by Sebastian McKenzie at Facebook and launched on October 11, 2016, as a collaboration between Facebook, Google, Exponent (now Expo), and Tilde. Facebook had relied on the npm client for years, but as its codebase and engineering team grew it hit problems with consistency, security, and installation performance, and built Yarn to address them. Yarn introduced a deterministic lockfile for reproducible installs across machines, installed packages in parallel rather than sequentially, and added an offline cache. Its arrival pushed the wider ecosystem forward, prompting npm to adopt lockfiles of its own. Set up from the start as its own GitHub organization, Yarn became fully independent of Facebook in 2019.
Sources
- Engineering at Meta — "Yarn: A new package manager for JavaScript" (2016) · as of 2026-07-17
- Yarn — official website · as of 2026-07-17