Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

yarn workspace

To learn more about workspaces, check these links:

yarn workspace <workspace_name> <command>

This will run the chosen Yarn command in the selected workspace.

Example:

yarn workspace awesome-package add react react-dom --dev

This will add react and react-dom as devDependencies in your packages/awesome-package/package.json.

If you want to remove a package:

yarn workspace web-project remove some-package

The example above would remove some-package from packages/web-project/package.json.