pnpm unlink
Aliases: dislink
Removes links created by pnpm link <dir> and reinstalls the packages as declared.
pnpm unlink [<pkg>...]
pnpm link records each link as a link: entry in the
overrides of
pnpm-workspace.yaml. pnpm unlink removes those overrides, all of them or
only the named ones, and then reinstalls. If no overrides are configured, it
prints Nothing to unlink and stops.
这类似于 yarn unlink,但 pnpm 会在删除外部链接后重新安装依赖项。
Since v12.7.0, if pnpm link <dir> added a link: dependency to package.json,
pnpm unlink removes that entry too, along with the package in node_modules
and its lockfile entry. A link: dependency that points to another directory is
kept.
Since v12.23.0, pnpm unlink also removes file: overrides that point to a directory, which pnpm link --hard writes. It keeps file: overrides to tarballs.
配置项#
--recursive, -r#
取消链接每个在子目录中找到的包。 在 工作空间 中执行时,会取消链接每个在工作空间包中找到的包。
--ignore-pnpmfile#
Don't load the hooks in .pnpmfile.cjs, including the pnpmfiles of config dependencies.