title: How do I make npm or yarn install a specific version of a specific sub-package from github?
body: <p>I have a <a href="https://github.com/rtsao/styletron" rel="noreferrer">repo</a> that I forked from a project on github with a structure like so:</p>
  
  <pre><code>myfork.git
    |
    -- packages
          |
          --subpackage1
                |
                --package.json
          |
          --subpackage2
                |
                --package.json
  </code></pre>
  
  <p>I made some minor modifications to subpackage1 in a separate branch foo. Now I want to use it in a project. So I tried the following</p>
  
  <pre><code>yarn add https://github.com/myuser/myfork.git/subpackage1#foo
  yarn add https://github.com/myuser/myfork.git/packages/subpackage1#foo
  </code></pre>
  
  <p>Then I tried without the branch specifier. Then I tried <code>npm install</code> instead of <code>yarn add</code>. Then I tried to just install without anything other than the base url which fails because there's no version number in the top-level <code>package.json</code>. I am clearly missing something here but I cannot figure out what.</p>