<h3 dir="auto">Current Behavior:</h3>
<p dir="auto"><code class="notranslate">npm uninstall --save &lt;package&gt;</code> doesn't remove the package version listed in <code class="notranslate">package.json</code> from <code class="notranslate">package-lock.json</code> when another version exists.</p>
<h3 dir="auto">Expected Behavior:</h3>
<p dir="auto">For the package version listed in <code class="notranslate">package.json</code> to be removed from <code class="notranslate">package-lock.json</code>. Essentially running <code class="notranslate">npm install --save &lt;package&gt; &amp;&amp; npm uninstall --save &lt;package&gt;</code> should leave <code class="notranslate">package-lock.json</code> unchanged.</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 init --yes
npm i --save-dev rollpkg
# rollpkg has a dependency of jest ^26.6.3, which is now in the top level node_modules
npm i --save-dev jest@26.0.0
# jest is added to package.json and
# jest 26.0.0 is now in top level node_modules, 26.6.3 is moved to node_mod/rollpkg/node_mod
npm uninstall --save-dev jest
# jest is removed from package.json
# but node_modules is unchanged"><pre class="notranslate">npm init --yes
npm i --save-dev rollpkg
<span class="pl-c"><span class="pl-c">#</span> rollpkg has a dependency of jest ^26.6.3, which is now in the top level node_modules</span>
npm i --save-dev jest@26.0.0
<span class="pl-c"><span class="pl-c">#</span> jest is added to package.json and</span>
<span class="pl-c"><span class="pl-c">#</span> jest 26.0.0 is now in top level node_modules, 26.6.3 is moved to node_mod/rollpkg/node_mod</span>
npm uninstall --save-dev jest
<span class="pl-c"><span class="pl-c">#</span> jest is removed from package.json</span>
<span class="pl-c"><span class="pl-c">#</span> but node_modules is unchanged</span></pre></div>
<h3 dir="auto">Environment:</h3>
<ul dir="auto">
<li>OS: MacOS 10.15.7</li>
<li>Node: 14.15.0</li>
<li>npm: 7.3.0</li>
</ul>
<p dir="auto">Thanks for all the great work on npm v7, I'm really enjoying using it!</p>
<p dir="auto">reporting error as suggested by error information .<br>
Tried uploading log file but it won't let me.. Here's whats was in the log:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'i',
1 verbose cli   '-g',
1 verbose cli   'powerbi-visuals-tools'
1 verbose cli ]
2 info using npm@6.14.7
3 info using node@v14.8.0
4 verbose npm-session fb296c27df366263
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 http fetch GET 500 https://registry.npmjs.org/powerbi-visuals-tools 79252ms attempt #3
8 timing npm Completed in 80146ms
9 error cb() never called!
10 error This is an error with npm itself. Please report this error at:
11 error &lt;https://npm.community&gt;"><pre class="notranslate"><code class="notranslate">0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'i',
1 verbose cli   '-g',
1 verbose cli   'powerbi-visuals-tools'
1 verbose cli ]
2 info using npm@6.14.7
3 info using node@v14.8.0
4 verbose npm-session fb296c27df366263
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 http fetch GET 500 https://registry.npmjs.org/powerbi-visuals-tools 79252ms attempt #3
8 timing npm Completed in 80146ms
9 error cb() never called!
10 error This is an error with npm itself. Please report this error at:
11 error &lt;https://npm.community&gt;
</code></pre></div>