跳到主内容
版本:10.x

功能比较

功能pnpmYarnnpm备注
Workspace support
隔离的 node_modulespnpm 中的默认值。
Hoisted node_modulesnpm 中的默认值。
Plug'n'PlayYarn 中的默认值。
Autoinstalling peers
零安装
Patching dependencies
Managing Node.js versions
Managing versions of itself
拥有锁文件pnpm-lock.yaml, yarn.lock, package-lock.json.
Overrides support在 Yarn 中称为“resolutions”。
内容可寻址存储Yarn uses a CAS when nodeLinker is set to pnpm.
Dynamic package executionpnpm dlx, yarn dlx, npx.
Side-effects cache
Catalogs
Config dependencies
JSR registry support
Auto-install before script run依赖项在 Yarn 中,即插即用(Plug'n'Play)可确保依赖项始终保持最新。
Hooks
Listing licensespnpm supports it via pnpm licenses list. Yarn 有一个插件来支持这个功能。

Note: To keep the comparison concise, we include only features likely to be used frequently.