機能の比較
機能 | pnpm | Yarn | npm | Notes |
---|---|---|---|---|
ワークスペースのサポート | ✅ | ✅ | ✅ | |
分離されたnode_modules | ✅ | ✅ | ✅ | Default in pnpm. |
ホイストされた node_modules | ✅ | ✅ | ✅ | Default in npm. |
Plug'n'Play | ✅ | ✅ | ❌ | Default in Yarn. |
Peerの自動インストール | ✅ | ❌ | ✅ | |
Zero-Installs | ❌ | ✅ | ❌ | |
依存関係のパッチ | ✅ | ✅ | ❌ | |
Node.jsバージョンの管理 | ✅ | ❌ | ❌ | |
Managing versions of itself | ✅ | ✅ | ❌ | |
ロックファイル | ✅ | ✅ | ✅ | pnpm-lock.yaml , yarn.lock , package-lock.json . |
オーバーライドのサポート | ✅ | ✅ | ✅ | Known as "resolutions" in Yarn. |
連想ストレージ | ✅ | ✅ | ❌ | Yarn uses a CAS when nodeLinker is set to pnpm . |
パッケージの直接実行 | ✅ | ✅ | ✅ | pnpm dlx , yarn dlx , npx . |
副作用キャッシュ | ✅ | ❌ | ❌ | |
Catalogs | ✅ | ❌ | ❌ | |
Config dependencies | ✅ | ❌ | ❌ | |
JSR registry support | ✅ | ✅ | ❌ | |
Auto-install before script run | ✅ | ❌ | ❌ | In Yarn, Plug'n'Play ensures dependencies are always up to date. |
フック | ✅ | ✅ | ❌ | |
ライセンスの一覧表示 | ✅ | ✅ | ❌ | pnpm supports it via pnpm licenses list . Yarn has a plugin for it. |
Note: To keep the comparison concise, we include only features likely to be used frequently.