<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">Running npm install does not install correct versions of dependencies in place of the existing old versions if the lockfile includes a version change in addition to dependency version upgrades. See reproduction for more details.</p>
<p dir="auto">Related or possibly a duplicate of: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="855103542" data-permission-text="Title is private" data-url="https://github.com/npm/cli/issues/3057" data-hovercard-type="issue" data-hovercard-url="/npm/cli/issues/3057/hovercard" href="https://github.com/npm/cli/issues/3057">#3057</a>, <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="877095477" data-permission-text="Title is private" data-url="https://github.com/npm/cli/issues/3196" data-hovercard-type="issue" data-hovercard-url="/npm/cli/issues/3196/hovercard" href="https://github.com/npm/cli/issues/3196">#3196</a>.</p>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">After running npm install, the dependencies in node_modules should match the lockfile contents.</p>
<h3 dir="auto">Steps To Reproduce</h3>
<ol dir="auto">
<li><code class="notranslate">git clone git@github.com:denis-sokolov/npm-6-to-7-old-dependency-reproduction.git &amp;&amp; cd npm-6-to-7-old-dependency-reproduction</code></li>
<li><code class="notranslate">git checkout base</code></li>
<li><code class="notranslate">npm6 install</code> (I used 6.14.9)</li>
<li><code class="notranslate">git checkout master</code></li>
<li><code class="notranslate">npm7 install</code> (I used 7.11.2)</li>
<li><code class="notranslate">cat node_modules/\@types/react-select/package.json  | grep 'version":'</code></li>
</ol>
<p dir="auto">Observed:</p>
<blockquote>
<p dir="auto">"version": "3.0.22"</p>
</blockquote>
<p dir="auto">Expected:</p>
<blockquote>
<p dir="auto">"version": "4.0.15",</p>
</blockquote>
<p dir="auto">Workaround: <code class="notranslate">rm -rf node_modules &amp;&amp; npm install</code>.</p>
<p dir="auto">If reproduction fails, please see the <code class="notranslate">with-node-modules</code> branch that has node_modules included in the repository.</p>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>OS: macOS 11.3.1</li>
<li>Node: 14.14.0</li>
<li>npm: 7.11.2, also reproduced with 7.13.0</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">This issue exists in the latest npm version</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I am using the latest npm</li>
</ul>
<h3 dir="auto">Current Behavior</h3>
<p dir="auto">It gives me this ERROR:</p>
<p dir="auto">npm ERR! Exit handler never called!</p>
<p dir="auto">npm ERR! This is an error with npm itself. Please report this error at:<br>
npm ERR!     <a href="https://github.com/npm/cli/issues">https://github.com/npm/cli/issues</a></p>
<p dir="auto">and in other versions this:</p>
<p dir="auto">npm ERR! code ECONNREFUSED<br>
npm ERR! syscall connect<br>
npm ERR! errno ECONNREFUSED<br>
npm ERR! FetchError: request to <a href="https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz" rel="nofollow">https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz</a> failed, reason: connect ECONNREFUSED 2606:4700::6810:1823:443<br>
npm ERR!     at ClientRequest. (C:\Program Files\nodejs\node_modules\npm\node_modules\minipass-fetch\lib\index.js:130:14)<br>
npm ERR!     at ClientRequest.emit (node:events:513:28)<br>
npm ERR!     at TLSSocket.socketErrorListener (node:_http_client:502:9)<br>
npm ERR!     at TLSSocket.emit (node:events:525:35)<br>
npm ERR!     at emitErrorNT (node:internal/streams/destroy:151:8)<br>
npm ERR!     at emitErrorCloseNT (node:internal/streams/destroy:116:3)<br>
npm ERR!     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)<br>
npm ERR!  FetchError: request to <a href="https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz" rel="nofollow">https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz</a> failed, reason: connect ECONNREFUSED 2606:4700::6810:1823:443<br>
npm ERR!     at ClientRequest. (C:\Program Files\nodejs\node_modules\npm\node_modules\minipass-fetch\lib\index.js:130:14)<br>
npm ERR!     at ClientRequest.emit (node:events:513:28)<br>
npm ERR!     at TLSSocket.socketErrorListener (node:_http_client:502:9)<br>
npm ERR!     at TLSSocket.emit (node:events:525:35)<br>
npm ERR!     at emitErrorNT (node:internal/streams/destroy:151:8)<br>
npm ERR!     at emitErrorCloseNT (node:internal/streams/destroy:116:3)<br>
npm ERR!     at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {<br>
npm ERR!   code: 'ECONNREFUSED',<br>
npm ERR!   errno: 'ECONNREFUSED',<br>
npm ERR!   syscall: 'connect',<br>
npm ERR!   address: '2606:4700::6810:1823',<br>
npm ERR!   port: 443,<br>
npm ERR!   type: 'system'<br>
npm ERR! }<br>
npm ERR!<br>
npm ERR! If you are behind a proxy, please make sure that the<br>
npm ERR! 'proxy' config is set properly.  See: 'npm help config'</p>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">it should install all dependencies from this project</p>
<h3 dir="auto">Steps To Reproduce</h3>
<ol dir="auto">
<li>clone vscode extension sample from this git repository: <a href="https://github.com/microsoft/vscode-extension-samples">https://github.com/microsoft/vscode-extension-samples</a></li>
<li>open cmd in vscode-extension-samples\lsp-sample</li>
<li>run: npm install</li>
</ol>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>npm: 9.6.4</li>
<li>Node.js: 20.0.0</li>
<li>OS Name: Windows 11</li>
<li>System Model Name:</li>
<li>npm config:<br>
{<br>
"json": true,<br>
"prefix": "C:\Users\helmu\AppData\Roaming\npm",<br>
"access": null,<br>
"all": false,<br>
"allow-same-version": false,<br>
"also": null,<br>
"audit": true,<br>
"audit-level": null,<br>
"auth-type": "web",<br>
"before": null,<br>
"bin-links": true,<br>
"browser": null,<br>
"ca": null,<br>
"cache": "C:\Users\helmu\AppData\Local\npm-cache",<br>
"cache-max": null,<br>
"cache-min": 0,<br>
"cafile": null,<br>
"call": "",<br>
"cert": null,<br>
"ci-name": null,<br>
"cidr": null,<br>
"color": true,<br>
"commit-hooks": true,<br>
"depth": null,<br>
"description": true,<br>
"dev": false,<br>
"diff": [],<br>
"diff-ignore-all-space": false,<br>
"diff-name-only": false,<br>
"diff-no-prefix": false,<br>
"diff-dst-prefix": "b/",<br>
"diff-src-prefix": "a/",<br>
"diff-text": false,<br>
"diff-unified": 3,<br>
"dry-run": false,<br>
"editor": "C:\WINDOWS\notepad.exe",<br>
"engine-strict": false,<br>
"fetch-retries": 2,<br>
"fetch-retry-factor": 10,<br>
"fetch-retry-maxtimeout": 60000,<br>
"fetch-retry-mintimeout": 10000,<br>
"fetch-timeout": 300000,<br>
"force": false,<br>
"foreground-scripts": false,<br>
"format-package-lock": true,<br>
"fund": true,<br>
"git": "git",<br>
"git-tag-version": true,<br>
"global": false,<br>
"globalconfig": "C:\Users\helmu\AppData\Roaming\npm\etc\npmrc",<br>
"global-style": false,<br>
"heading": "npm",<br>
"https-proxy": null,<br>
"if-present": false,<br>
"ignore-scripts": false,<br>
"include": [],<br>
"include-staged": false,<br>
"include-workspace-root": false,<br>
"init-author-email": "",<br>
"init-author-name": "",<br>
"init-author-url": "",<br>
"init-license": "ISC",<br>
"init-module": "C:\Users\helmu\.npm-init.js",<br>
"init-version": "1.0.0",<br>
"init.author.email": "",<br>
"init.author.name": "",<br>
"init.author.url": "",<br>
"init.license": "ISC",<br>
"init.module": "C:\Users\helmu\.npm-init.js",<br>
"init.version": "1.0.0",<br>
"install-links": false,<br>
"install-strategy": "hoisted",<br>
"key": null,<br>
"legacy-bundling": false,<br>
"legacy-peer-deps": false,<br>
"link": false,<br>
"local-address": null,<br>
"location": "user",<br>
"lockfile-version": null,<br>
"loglevel": "notice",<br>
"logs-dir": null,<br>
"logs-max": 10,<br>
"long": false,<br>
"maxsockets": 15,<br>
"message": "%s",<br>
"node-options": null,<br>
"noproxy": [<br>
""<br>
],<br>
"offline": false,<br>
"omit": [],<br>
"omit-lockfile-registry-resolved": false,<br>
"only": null,<br>
"optional": null,<br>
"otp": null,<br>
"package": [],<br>
"package-lock": true,<br>
"package-lock-only": false,<br>
"pack-destination": ".",<br>
"parseable": false,<br>
"prefer-offline": false,<br>
"prefer-online": false,<br>
"preid": "",<br>
"production": null,<br>
"progress": true,<br>
"provenance": false,<br>
"proxy": null,<br>
"read-only": false,<br>
"rebuild-bundle": true,<br>
"registry": "<a href="https://registry.npmjs.org/" rel="nofollow">https://registry.npmjs.org/</a>",<br>
"replace-registry-host": "npmjs",<br>
"save": true,<br>
"save-bundle": false,<br>
"save-dev": false,<br>
"save-exact": false,<br>
"save-optional": false,<br>
"save-peer": false,<br>
"save-prefix": "^",<br>
"save-prod": false,<br>
"scope": "",<br>
"script-shell": null,<br>
"searchexclude": "",<br>
"searchlimit": 20,<br>
"searchopts": "",<br>
"searchstaleness": 900,<br>
"shell": "C:\WINDOWS\system32\cmd.exe",<br>
"shrinkwrap": true,<br>
"sign-git-commit": false,<br>
"sign-git-tag": false,<br>
"strict-peer-deps": false,<br>
"strict-ssl": true,<br>
"tag": "latest",<br>
"tag-version-prefix": "v",<br>
"timing": false,<br>
"tmp": "C:\Users\helmu\AppData\Local\Temp",<br>
"umask": 0,<br>
"unicode": true,<br>
"update-notifier": true,<br>
"usage": false,<br>
"user-agent": "npm/{npm-version} node/{node-version} {platform} {arch} workspaces/{workspaces} {ci}",<br>
"userconfig": "C:\Users\helmu\.npmrc",<br>
"version": false,<br>
"versions": false,<br>
"viewer": "browser",<br>
"which": null,<br>
"workspace": [],<br>
"workspaces": null,<br>
"workspaces-update": true,<br>
"yes": null,<br>
"metrics-registry": "<a href="https://registry.npmjs.org/" rel="nofollow">https://registry.npmjs.org/</a>"<br>
}</li>
</ul>