yarn unlink

npm install yarn -g

取消一个以前创建的包符号链接。

要移除一个使用 yarn link 创建的符号链接的包,可以使用 yarn unlink

在之前用来创建链接的目录里运行 yarn unlink

要取消开发期间你项目里用符号链接的包,简单运行 yarn unlink [package] 即可。 你需要运行 yarnyarn install 重新安装已经用符号链接的包。

Continued example from the yarn link documentation: assume two folders react and react-relay that are located next to each other with react linked into the react-relay project:


$ cd react
$ yarn unlink
yarn link vx.x.x
success Unregistered "react".

$ cd ../react-relay
$ yarn unlink react
yarn link vx.x.x
success Unregistered "react".

另请参见:

  • yarn link: 在本地开发环境里符号链接一个包。