title: How does npm handle circular dependency?
body: <p>Just wondering, if there is a package with circular/cyclic dependency, does npm handle that? How? I have googled but couldn't find very useful results.</p>
  
  <hr>
  
  <p>I can think of two kinds of problems here:</p>
  
  <ol>
  <li><p>Circular dependency with same version: <code>A-&gt;B</code>, <code>B-&gt;C</code>, <code>C-&gt;A</code></p>
  
  <p>Does npm build the dependency like this? (Only my guess, didn't find any circular dependency to actually test on)</p>
  
  <pre><code>A@1.0.0
  └─┬ B@1.0.0
    └─┬ C@1.0.0
      └── A@1.0.0 (deduped)
  </code></pre></li>
  <li><p>Circular dependency with different version: <code>A@2.0.0-&gt;B</code>, <code>B-&gt;C</code>, <code>C-&gt;A@^1.0.0</code>, I cannot even guess what would happen if such things exist?</p></li>
  </ol>