npm/pnpm/yarn
Yarn Commands
Use Yarn for reliable, fast package management. Yarn Classic (v1) and Yarn Berry (v2+) offer different approaches — from offline caching to Plug'n'Play zero-installs.
4 commands
Pro Tips
Yarn Berry's PnP mode eliminates node_modules entirely. Use 'yarn set version berry' to upgrade.
Use 'yarn dlx' to run one-off packages — Yarn's equivalent of npx.
Yarn's 'resolutions' field in package.json forces specific versions of transitive dependencies.
Common Mistakes
Yarn Classic (v1) is in maintenance mode. Yarn Berry (v2+) is the active version with different behavior.
Yarn PnP breaks tools that assume node_modules exists. Add them to '.yarnrc.yml' packageExtensions if needed.