Skip to main content
Version: 11.x

pnpm unlink

取消链接系统范围的包(pnpm link 的反向操作)。

🌐 Unlinks a system-wide package (inverse of pnpm link).

如果在未提供参数的情况下调用,当前项目中的所有关联依赖将被取消关联。

🌐 If called without arguments, all linked dependencies will be unlinked inside the current project.

这类似于 yarn unlink,只是 pnpm 会在移除外部链接后重新安装依赖。

🌐 This is similar to yarn unlink, except pnpm re-installs the dependency after removing the external link.

info

如果你想移除使用 pnpm link --global <package> 创建的链接,你应该使用 pnpm uninstall --global <package>pnpm unlink 只会移除你当前目录下的链接。

🌐 If you want to remove a link made with pnpm link --global <package>, you should use pnpm uninstall --global <package>. pnpm unlink only removes the links in your current directory.

选项

🌐 Options

--recursive, -r

在子目录中找到的每个包或每个工作区包中取消链接,当在工作区内执行时。

🌐 Unlink in every package found in subdirectories or in every workspace package, when executed inside a workspace.

--filter <package_selector>

了解更多关于筛选的信息。