Yarn
Discouraged
Not our default choice. We recommend npm for all projects.
What is itโ
Yarn is a package manager originally created by Facebook (Meta) as an alternative to npm. Yarn Classic (v1) is in maintenance mode; Yarn Berry (v2+) introduced Plug'n'Play (PnP), which eliminates node_modules entirely. Currently at v4.x.
Why it's not our defaultโ
- Fragmented versions โ Yarn Classic and Yarn Berry are effectively different tools with different semantics, causing confusion.
- Plug'n'Play compatibility โ Yarn Berry's PnP mode breaks many tools that assume a
node_modulesfolder; requires patching ornodeLinker: node-modulesfallback. - Extra install step โ like pnpm, Yarn doesn't ship with Node.js.
- Diminishing advantages โ Yarn's original benefits (lockfile, determinism, speed) have been adopted by npm.
- Smaller mindshare โ npm is universal; Yarn adds a knowledge requirement without clear benefit for most projects.
When it makes senseโ
- Existing Yarn project โ if you're maintaining or extending a project already using Yarn, there's no need to force a migration.
- Client requirement โ if the client mandates Yarn.
Alternativeโ
Resourcesโ
- Yarn website
- Yarn docs
- npm โ our recommended package manager