<h3 dir="auto">Is there an existing issue for this?</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the existing issues</li>
</ul>
<h3 dir="auto">Current Behavior</h3>
<p dir="auto">NPM won't update / install.    You need a much better QA Team!</p>
<p dir="auto">npm install -g npm@7.19.1</p>
<p dir="auto">C:\Users\shane&gt;npm install -g npm@7.19.1<br>
npm ERR! code EPERM<br>
npm ERR! syscall rename<br>
npm ERR! path C:\Program Files\nodejs\node_modules\npm<br>
npm ERR! dest C:\Program Files\nodejs\node_modules.npm-QXjMEw5N<br>
npm ERR! errno -4048<br>
npm ERR! Error: EPERM: operation not permitted, rename 'C:\Program Files\nodejs\node_modules\npm' -&gt; 'C:\Program Files\nodejs\node_modules.npm-QXjMEw5N'<br>
npm ERR!  [Error: EPERM: operation not permitted, rename 'C:\Program Files\nodejs\node_modules\npm' -&gt; 'C:\Program Files\nodejs\node_modules.npm-QXjMEw5N'] {<br>
npm ERR!   errno: -4048,<br>
npm ERR!   code: 'EPERM',<br>
npm ERR!   syscall: 'rename',<br>
npm ERR!   path: 'C:\Program Files\nodejs\node_modules\npm',<br>
npm ERR!   dest: 'C:\Program Files\nodejs\node_modules\.npm-QXjMEw5N'<br>
npm ERR! }<br>
npm ERR!<br>
npm ERR! The operation was rejected by your operating system.<br>
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),<br>
npm ERR! or that you lack permissions to access it.<br>
npm ERR!<br>
npm ERR! If you believe this might be a permissions issue, please double-check the<br>
npm ERR! permissions of the file and its containing directories, or try running<br>
npm ERR! the command again as root/Administrator.</p>
<p dir="auto">npm ERR! A complete log of this run can be found in:<br>
npm ERR!     C:\Users\shane\AppData\Local\npm-cache_logs\2021-07-04T20_52_55_775Z-debug.log</p>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">I expected that it would work flawlessly the first time, this is why Developers switched over to package managers, otherwise all it did was create an even bigger mess to straighten out.</p>
<h3 dir="auto">Steps To Reproduce</h3>
<p dir="auto">Windows 10 latest<br>
64 bit OS<br>
run cmd listed at very top of bug report.<br>
get real frustrated that NPM can't auto send a bug report back to the team so they can instantaneously see millions of failures from their last release before a holiday weekend.    I mean really, why isn't this baked into this thing?  Should be Feature of the highest priority.</p>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>OS:</li>
<li>Node:</li>
<li>npm:</li>
</ul>
<h3 dir="auto">Is there an existing issue for this?</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the existing issues</li>
</ul>
<h3 dir="auto">Current Behavior</h3>
<p dir="auto">I have the following specified <code class="notranslate">package.json</code>:</p>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
  &quot;dependencies&quot;: {
    &quot;wpsjs-rpc-sdk&quot;: &quot;1.0.27&quot;
  },
  &quot;devDependencies&quot;: {
    &quot;wpsjs&quot;: &quot;1.4.11&quot;
  }
}"><pre class="notranslate">{
  <span class="pl-ent">"dependencies"</span>: {
    <span class="pl-ent">"wpsjs-rpc-sdk"</span>: <span class="pl-s"><span class="pl-pds">"</span>1.0.27<span class="pl-pds">"</span></span>
  },
  <span class="pl-ent">"devDependencies"</span>: {
    <span class="pl-ent">"wpsjs"</span>: <span class="pl-s"><span class="pl-pds">"</span>1.4.11<span class="pl-pds">"</span></span>
  }
}</pre></div>
<p dir="auto"><code class="notranslate">wpsjs</code> has specified its dependencies with <code class="notranslate">wpsjs-rpc-sdk@latest</code> which has been pointed to <code class="notranslate">1.0.28</code>, but after installation, npm still dedupe it as <code class="notranslate">1.0.27</code></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="npm ls wpsjs-rpc-sdk

+-- wpsjs-rpc-sdk@1.0.27
`-- wpsjs@1.4.11
  `-- wpsjs-rpc-sdk@1.0.27 deduped"><pre class="notranslate"><code class="notranslate">npm ls wpsjs-rpc-sdk

+-- wpsjs-rpc-sdk@1.0.27
`-- wpsjs@1.4.11
  `-- wpsjs-rpc-sdk@1.0.27 deduped
</code></pre></div>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">It is expected that npm should not dedupe the library since <code class="notranslate">1.0.27</code> has not been the latest one, and construct a structure like this after installation:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="npm ls wpsjs-rpc-sdk

+-- wpsjs-rpc-sdk@1.0.27
`-- wpsjs@1.4.11
  `-- wpsjs-rpc-sdk@1.0.28 (latest)"><pre class="notranslate"><code class="notranslate">npm ls wpsjs-rpc-sdk

+-- wpsjs-rpc-sdk@1.0.27
`-- wpsjs@1.4.11
  `-- wpsjs-rpc-sdk@1.0.28 (latest)
</code></pre></div>
<h3 dir="auto">Steps To Reproduce</h3>
<p dir="auto">With the <code class="notranslate">package.json</code> mentioned above, we can reproduce the problem</p>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>OS: Windows</li>
<li>Node: 16.9.1</li>
<li>npm: 7.21.1</li>
</ul>