title: How do I update all subfolder package.json in a monorepo to the same version?
body: <p>I have a repository with a bunch of different front-end React projects, which all have package.json files of their own.</p>
  <p>I have four requrements:</p>
  <ol>
  <li>I want to keep all of these projects on the same dependency track. (ie, I want all my projects to use the same versions of each npm package)</li>
  <li>I want to be able to update every package.json to their latest version, with one &quot;global&quot; command.</li>
  <li>Ideally, I'd like to use some sort of proven open-source tool like Yarn Workspaces or Lerna, instead of managing this all myself with a global package.json file.</li>
  <li>I'm using the Yarn ecosystem.</li>
  </ol>
  <p>These packages do not need to run concurrently. Not every project contains the same exact dependencies, but all contain at least a few common dependencies (ie React, Webpack, Babel, etc). These packages are also entirely private and should not be published on npm, only on GitHub.</p>
  <p>I've done some research into the tooling and am confused about if Yarn Workspaces alone is the solution, or if Lerna is necessary. Here's what I've done so far in Yarn Workspaces:</p>
  <p>Folder structure:</p>
  <pre><code>Repo-root
     Packages
        Project-1
        Project-2
  </code></pre>
  <p>Repo root package.json:</p>
  <pre><code>{
     &quot;private&quot;: true,
     &quot;name&quot;: &quot;example-monorepo&quot;,
     &quot;workspaces&quot;: [&quot;packages/*&quot;],
     &quot;scripts&quot;: {}
  }
  </code></pre>
  <p>I understand that Yarn Workspaces tries to move all common dependencies to the root node_modules behind-the-scenes, but I'm confused about how to accomplish the shared dependency installation and updating to the latest versions requirement. Can Yarn Workspaces accomplish the requirements on its own, or is Lerna necessary for this? How would this be accomplished in Lerna? Do I need to define a global package.json &quot;single source of truth&quot;, or do the tools do some version of it themselves behind the scenes? How does Lerna or Yarn Workspaces &quot;know&quot; how to update all the individual package.json files to their latest versions without a global set of version ranges? (which I want to be the same for all projects)</p>