title: npm link removes child dependencies
body: <p>I am trying to do local development of an NPM package and test it in a package which depends on it. I'm using NPM (7.5.3) and specifically <code>npm link</code> for this but running into a problem with the chain of dependencies.</p>
  <p>The child package has dependencies, these are all added to the parent's node_modules folder when using <code>npm install &quot;git+https://github.com/name/child_package&quot;</code>. But when I <code>npm link</code> that module:</p>
  <pre class="lang-sh prettyprint-override"><code>cd child_package
  npm link
  cd ../parent_package
  npm link child_package
  </code></pre>
  <p>With the last command run (<code>npm link child_package</code>), all of the dependencies for <code>child_package</code> which were in the node_modules of <code>parent_package</code> are removed. NPM reporting:</p>
  <blockquote>
  <p>removed 60 packages, changed 1 package, and audited 231 packages in 1s</p>
  </blockquote>
  <p>At which point all the compilation in the parent package fails due to the missing deps. It finds the child_package, which is symlinked as expected, but dependency defined in child_package of &quot;gsap&quot; has now been removed.</p>
  <p>If I reinstall it using <code>npm install &quot;git+https://github.com/name/child_package&quot;</code> it will add the deps back into the node_modules folder of the parent project.</p>