You are on page 1of 3

Important: This documentation covers Yarn 1 (Classic).

For Yarn 2+ docs and migration guide, see yarnpkg.com.

Search packages (i.e. babel, webpack, react…)

yarn workspace

To learn more about workspaces, check these links:

• Workspaces in Yarn
• Workspaces

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 .

← yarn why yarn workspaces →

CLI Introduction
yarn add
yarn audit
yarn autoclean
yarn bin
yarn cache
yarn check
yarn config
yarn create
yarn dedupe
yarn generate-lock-entry
yarn global
yarn help
yarn import
yarn info
yarn init
yarn install
yarn licenses
yarn link
yarn list
yarn lockfile
yarn login
yarn logout
yarn outdated
yarn owner
yarn pack
yarn policies
yarn prune
yarn publish
yarn remove
yarn run
yarn self-update
yarn tag
yarn team
yarn test
yarn unlink
yarn upgrade
yarn upgrade-interactive
yarn version
yarn versions
yarn why
yarn workspace
yarn workspaces

Yarn Edit this page


Distributed under BSD License
Code of Conduct

You might also like