yarn unlink — Yarn CLI reference

Remove local links from the current project

Docs/Reference/CLI/unlink

yarn unlink

Remove local links from the current project

yarn unlink <TARGETS…>

This command removes portal: resolutions from the top-level manifest. It is the counterpart to yarn link.

If the --all flag is used without any arguments, Yarn will remove all resolutions that use the portal: protocol.

If the --all flag is used with a path argument, Yarn will unlink all workspaces from the specified project.

Otherwise, you can specify package names (with glob support) or paths to individual packages to unlink specific resolutions.

#--all, -Aboolean

Unlink all portal resolutions, or all workspaces from the target project

Examples#

Unregister a remote workspace in the current project

yarn unlink ~/ts-loader

Unregister all workspaces from a remote project in the current project

yarn unlink ~/jest --all

Unregister all previously linked workspaces

yarn unlink --all

Unregister all workspaces matching a glob

yarn unlink '@babel/*' 'pkg-{a,b}'