<p dir="auto"><a href="https://github.com/npm/cli/files/6138471/npmBug.zip">npmBug.zip</a></p>
<h3 dir="auto">Current Behavior:</h3>
<p dir="auto">When <code class="notranslate">npm i --production</code> is called, all project files referenced in devDependencies are deleted</p>
<h3 dir="auto">Expected Behavior:</h3>
<p dir="auto">npm doesn't delete our project files</p>
<h3 dir="auto">Steps To Reproduce:</h3>
<ol dir="auto">
<li>Run <code class="notranslate">npm i --production</code> in the <code class="notranslate">main</code> directory of the attached zip.</li>
<li>The <code class="notranslate">dependencies</code> folder will be deleted as a result of step 1</li>
</ol>
<h3 dir="auto">Environment:</h3>
<ul dir="auto">
<li>OS: MacOS Catalina 10.15.7</li>
<li>Node: 14.7.0</li>
<li>npm: 7.6.3</li>
</ul>
<h3 dir="auto">Current Behavior:</h3>

<p dir="auto">We have a local development dependency defined like this:</p>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="  &quot;devDependencies&quot;: {
    &quot;our-local-dependency&quot;: &quot;../../lib/our-local-dependency&quot;
  }"><pre class="notranslate">  <span class="pl-ent">"devDependencies"</span>: {
    <span class="pl-ent">"our-local-dependency"</span>: <span class="pl-s"><span class="pl-pds">"</span>../../lib/our-local-dependency<span class="pl-pds">"</span></span>
  }</pre></div>
<p dir="auto">When running <code class="notranslate">npm prune --production</code>, npm does not only delete the softlink but also the directory it is pointing to.</p>
<h3 dir="auto">Expected Behavior:</h3>

<p dir="auto">My assumption was that only the softlink would be deleted, but not the actual dependency itself</p>
<h3 dir="auto">Steps To Reproduce:</h3>

<ol dir="auto">
<li>Create a project with a local development dependency</li>
<li>run <code class="notranslate">npm install</code></li>
<li>run <code class="notranslate">npm prune --production</code></li>
</ol>
<h3 dir="auto">Environment:</h3>

<ul dir="auto">
<li>OS: Debian bullseye/sid</li>
<li>Node: v12.16.3 (nvm)</li>
<li>npm: 7.6.3 (I was able to reproduce this issue with 6.x.x as well)</li>
</ul>