title: Within a yarn workspace, how can I force a resolution for a child project's dependency?
body: <p>I'm using a library that has supports another library with a wide range of versions as a peer dependency.  Unfortunately, one of the child projects of the workspace pulls in a version different from the child project that uses the library.  As a result, they end up requiring different versions.</p>
  
  <p>I'm trying to use selective resolutions to handle this and force it to use the correct version (<a href="https://yarnpkg.com/lang/en/docs/selective-version-resolutions/" rel="noreferrer">https://yarnpkg.com/lang/en/docs/selective-version-resolutions/</a>) but I'm not having any luck.  </p>
  
  <p>It's possible I'm misunderstanding how to utilize these.</p>
  
  <p>My current setup is I have a root workspace with these children inside:
  Project A package.json (which is the source of the issue):</p>
  
  <pre><code>   dependencies: {
        backbone.marionette: '2.4.1'
     }
  </code></pre>
  
  <p>Project B package.json (which is the application having issues):</p>
  
  <pre><code>  dependencies: {
           backbone.marionette: '1.8.8',
           @organization/UILibrary: '0.0.22'
     }
  </code></pre>
  
  <p>The @organization/UILibrary (which is outside the workspace) package.json looks like so:</p>
  
  <pre><code>  peerDependencies: {
         backbone.marionette: "&gt;= 1 &lt; 3"
    }
  </code></pre>
  
  <p>Unfortunately, even though Project B has no dependency on Project A, when @organization/UILibrary is pulled into Project B it gets backbone.marionette version 2.4.1 for it's requires (whereas the requires local to Project B get 1.8.8).</p>
  
  <p>My attempt to use resolutions is updating Project B package.json to this:</p>
  
  <pre><code>   dependencies: {
           backbone.marionette: '1.8.8',
           @organization/UILibrary: '0.0.22'
      },
      {
      "resolutions": {
          "@organization/**/backbone.marionette": "1.8.8",
          "@organization/backbone.marionette": "1.8.8",
          "@organization/UILibrary/backbone.marionette: "1.8.8",
          "@organization/UILibrary/**/backbone.marionette: '1.8.8"
      }
  </code></pre>
  
  <p>Any ideas? Based on some digging in yarn's issues and some of their selective dependency PRs (see <a href="https://github.com/yarnpkg/yarn/issues/4874" rel="noreferrer">https://github.com/yarnpkg/yarn/issues/4874</a>) I believe it may be due to the fact that the UILibrary is scoped (has a slash).</p>