title: Yarn Link All Packages/Workspaces
body: <p>Yarn's <a href="https://yarnpkg.com/lang/en/docs/cli/link/" rel="nofollow noreferrer">link</a> allows you to register a local package for symlinking into another local package. To use <code>link</code> you cd into the package directory and run <code>yarn link</code>. This works fine on individual packages, however I have a monorepo, using Yarn's workspaces alongside Lerna. There are many packages, and I would like a simple way of linking all the packages within the monorepo.</p>
  
  <p>My <code>package.json</code>:</p>
  
  <pre><code>…
    "workspaces": [
      "packages/*"
    ],
  …
  </code></pre>
  
  <p>My <code>lerna.json</code>:</p>
  
  <pre><code>{
    "npmClient": "yarn",
    "useWorkspaces": true,
    "packages": [
      "packages/*"
    ],
    …
  }
  </code></pre>
  
  <p><strong>Is there a simple way to run <code>yarn link</code> (and <code>yarn unlink</code>) on each package?</strong></p>