<h3 dir="auto">Current Behavior:</h3>
<p dir="auto">As already <a href="https://github.com/npm/cli/issues/2639#issuecomment-775490191" data-hovercard-type="issue" data-hovercard-url="/npm/cli/issues/2639/hovercard">noted by someone else</a>, there seems to be a problem with install/update of global packages:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ npm up -g
npm ERR! code EPERM
npm ERR! syscall mkdir
npm ERR! path C:\Program Files\nodejs\node_modules\.npm-QXjMEw5N
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\.npm-QXjMEw5N'
npm ERR!  [Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\.npm-QXjMEw5N'] {
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'mkdir',
npm ERR!   path: 'C:\\Program Files\\nodejs\\node_modules\\.npm-QXjMEw5N'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\rbauer\AppData\Local\npm-cache\_logs\2021-03-08T10_46_40_199Z-debug.log"><pre class="notranslate"><code class="notranslate">$ npm up -g
npm ERR! code EPERM
npm ERR! syscall mkdir
npm ERR! path C:\Program Files\nodejs\node_modules\.npm-QXjMEw5N
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\.npm-QXjMEw5N'
npm ERR!  [Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\.npm-QXjMEw5N'] {
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'mkdir',
npm ERR!   path: 'C:\\Program Files\\nodejs\\node_modules\\.npm-QXjMEw5N'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\rbauer\AppData\Local\npm-cache\_logs\2021-03-08T10_46_40_199Z-debug.log
</code></pre></div>
<p dir="auto"><a href="https://github.com/npm/cli/files/6100819/2021-03-08T10_46_40_199Z-debug.log">2021-03-08T10_46_40_199Z-debug.log</a></p>
<h3 dir="auto">Expected Behavior:</h3>
<p dir="auto">Packages get updated.</p>
<h3 dir="auto">Environment:</h3>
<ul dir="auto">
<li>OS: Windows 10</li>
<li>Node: 14.16.0</li>
<li>npm: 7.5.6</li>
</ul>
<h3 dir="auto">Current Behavior:</h3>
<p dir="auto">Attempting to update a package with a tag using the <code class="notranslate">update</code> command globally causes <strong>ALL</strong> global packages to be removed.</p>
<h3 dir="auto">Expected Behavior:</h3>
<p dir="auto">Packages should not be removed when updating global packages.</p>
<h3 dir="auto">Steps To Reproduce:</h3>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="npm i -g typescript nodemon @angular/cli # Install some global packages
npm ls -g --depth=0 # This shows the 3 installed packages
npm update -g @angular/cli@latest # Attempt to update one of the packages with a @latest tag
# Oh no! removed 620 packages
npm ls -g --depth=0 # Shows `-- (empty)"><pre class="notranslate">npm i -g typescript nodemon @angular/cli <span class="pl-c"><span class="pl-c">#</span> Install some global packages</span>
npm ls -g --depth=0 <span class="pl-c"><span class="pl-c">#</span> This shows the 3 installed packages</span>
npm update -g @angular/cli@latest <span class="pl-c"><span class="pl-c">#</span> Attempt to update one of the packages with a @latest tag</span>
<span class="pl-c"><span class="pl-c">#</span> Oh no! removed 620 packages</span>
npm ls -g --depth=0 <span class="pl-c"><span class="pl-c">#</span> Shows `-- (empty)</span></pre></div>
<h3 dir="auto">Environment:</h3>
<ul dir="auto">
<li>OS: Windows 10 20H2</li>
<li>Node: 15.9.0</li>
<li>npm: 7.11.2</li>
</ul>
<h3 dir="auto">Additional Info</h3>
<p dir="auto">This only happens on the global scope</p>