pnpm dedupe
如果可以使用较新的版本,则执行安装并删除锁文件中的较旧依赖项。
Workspace selection#
Since v12.4.1, pnpm dedupe processes every project in the workspace by default, including workspaces that keep a lockfile per project. Narrow the run with the usual filters, for example pnpm dedupe --filter ./packages/app.
配置项#
--check#
在不安装软件包或编辑锁文件下检查运行 dedupe 是否会导致更改。如果可能存在更改,则以非零状态代码退出。
The check ignores registry metadata that changed after the lockfile was written: deprecated notices, and the integrity of a locked version that the registry now reports with a stronger hash algorithm, such as sha512 instead of sha1. An integrity with a weaker algorithm, or with another digest of the same algorithm, is still reported, and so is any metadata change in a lockfile with CRLF line endings or a byte order mark, since pnpm would rewrite those bytes too.
The check still installs configDependencies. If they changed since the last install, it also records them in the lockfile, as pnpm install does, and reports the change.
--lockfile-only#
Only update pnpm-lock.yaml. Packages are not downloaded and node_modules is not written.
--ignore-scripts#
Don't run lifecycle scripts of the project or its dependencies.
--ignore-pnpmfile#
Don't run the hooks of the pnpmfile.
--offline#
Use only packages already in the store. A package missing from the store fails the command.
--prefer-offline#
Prefer cached packages and metadata over the network, even past their freshness window.
--no-runtime#
Skip installing runtime entries, such as Node.js downloaded via devEngines.runtime. Works like pnpm install --no-runtime.
--filter <package_selector>#
Restrict the command to the selected projects. 阅读更多有关过滤的内容。
--fail-if-no-match#
Exit with an error when no project matches the given filters, instead of doing nothing.