<p dir="auto">Installing any package causes this error. I am currently using Windows 10 and NodeJS v17.</p>
<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">npm install doesn't work either way. After upgrading Node JS to v17.4.0 and npm to v8.4.0 npm install gives two errors with different packages every time which completely halts or crashes the process.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="PS E:\VS projs\react-app&gt; npx create-react-app app

Creating a new React app in E:\VS projs\react-app\app.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
npm ERR! code ERR_SSL_CIPHER_OPERATION_FAILED
npm ERR! A4250000:error:1C800066:Provider routines:ossl_gcm_stream_update:cipher operation
failed:c:\ws\deps\openssl\openssl\providers\implementations\ciphers\ciphercommon_gcm.c:312:
npm ERR!

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\ruturaj_k\AppData\Local\npm-cache\_logs\2022-01-30T09_11_05_521Z-debug-0.log

Aborting installation.
  npm install --no-audit --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.

Deleting generated file... node_modules
Deleting generated file... package.json
Deleting app/ from E:\VS projs\react-app
Done."><pre class="notranslate"><code class="notranslate">PS E:\VS projs\react-app&gt; npx create-react-app app

Creating a new React app in E:\VS projs\react-app\app.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
npm ERR! code ERR_SSL_CIPHER_OPERATION_FAILED
npm ERR! A4250000:error:1C800066:Provider routines:ossl_gcm_stream_update:cipher operation
failed:c:\ws\deps\openssl\openssl\providers\implementations\ciphers\ciphercommon_gcm.c:312:
npm ERR!

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\ruturaj_k\AppData\Local\npm-cache\_logs\2022-01-30T09_11_05_521Z-debug-0.log

Aborting installation.
  npm install --no-audit --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.

Deleting generated file... node_modules
Deleting generated file... package.json
Deleting app/ from E:\VS projs\react-app
Done.
</code></pre></div>
<p dir="auto">I felt I had this issue only on my machine so I checked out on different machine with macOS platform and firstly it produces the above error and then when ran second time it give the SOCKET_TIMEOUT error.</p>
<p dir="auto">There's still more to this<br>
I checked with another machine with windows platform and sadly it doesn't work there either. I tested it with a highspeed connection and it's still the same :( .<br>
<a href="https://github.com/npm/cli/files/7971163/2022-01-31T09_34_56_431Z-debug-0.log">2022-01-31T09_34_56_431Z-debug-0.log</a></p>
<h3 dir="auto">Expected Behavior</h3>
<blockquote>
<ol dir="auto">
<li>Expected to install the required packages and create a react app.</li>
<li>Expected to install global modules without any error</li>
</ol>
</blockquote>
<p dir="auto">Expected output</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/65947291/151805817-aca37524-177e-43e7-a113-65e21114e1cf.png"><img src="https://user-images.githubusercontent.com/65947291/151805817-aca37524-177e-43e7-a113-65e21114e1cf.png" alt="image" style="max-width: 100%;"></a></p>
<h3 dir="auto">Steps To Reproduce</h3>
<ol dir="auto">
<li>Open Terminal / Command Prompt</li>
<li>Type <code class="notranslate">npm install -g nodemon</code> or  <code class="notranslate">npx create-react-app my-app</code></li>
<li>Fetches some packages.</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Creating a new React app in E:\VS projs\react-app\app.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template..."><pre class="notranslate"><code class="notranslate">Creating a new React app in E:\VS projs\react-app\app.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
</code></pre></div>
<ol start="4" dir="auto">
<li>Then suddenly logs an error stoping the install.</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="npm ERR! code ERR_SSL_CIPHER_OPERATION_FAILED
npm ERR! A4250000:error:1C800066:Provider routines:ossl_gcm_stream_update:cipher operation
failed:c:\ws\deps\openssl\openssl\providers\implementations\ciphers\ciphercommon_gcm.c:312:
npm ERR!"><pre class="notranslate"><code class="notranslate">npm ERR! code ERR_SSL_CIPHER_OPERATION_FAILED
npm ERR! A4250000:error:1C800066:Provider routines:ossl_gcm_stream_update:cipher operation
failed:c:\ws\deps\openssl\openssl\providers\implementations\ciphers\ciphercommon_gcm.c:312:
npm ERR!
</code></pre></div>
<p dir="auto">and sometimes</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="verbose npm  v8.4.0
4743 error code ERR_SOCKET_TIMEOUT
4744 error errno ERR_SOCKET_TIMEOUT
4745 error network Invalid response body while trying to fetch https://registry.npmjs.org/dotenv: Socket timeout
4746 error network This is a problem related to network connectivity.
4746 error network In most cases you are behind a proxy or have bad network settings.
4746 error network
4746 error network If you are behind a proxy, please make sure that the
4746 error network 'proxy' config is set properly.  See: 'npm help config"><pre class="notranslate"><code class="notranslate">verbose npm  v8.4.0
4743 error code ERR_SOCKET_TIMEOUT
4744 error errno ERR_SOCKET_TIMEOUT
4745 error network Invalid response body while trying to fetch https://registry.npmjs.org/dotenv: Socket timeout
4746 error network This is a problem related to network connectivity.
4746 error network In most cases you are behind a proxy or have bad network settings.
4746 error network
4746 error network If you are behind a proxy, please make sure that the
4746 error network 'proxy' config is set properly.  See: 'npm help config
</code></pre></div>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>npm: v8.4.0</li>
<li>Node.js: v17.4.0</li>
<li>OS Name: Windows 10 Pro Build 9043.1503 Version 21H1</li>
<li>npm config:</li>
</ul>
<div class="highlight highlight-source-ini notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="npm config ls `; &quot;builtin&quot; config from C:\Users\ruturaj_k\AppData\Roaming\npm\node_modules\npm\npmrc

prefix = &quot;C:\\Users\\ruturaj_k\\AppData\\Roaming\\npm&quot;

; node bin location = C:\Program Files\nodejs\node.exe
; cwd = C:\WINDOWS\system32
; HOME = C:\Users\ruturaj_k
; Run `npm config ls -l` to show all defaults.` here

"><pre class="notranslate">npm config ls `<span class="pl-c"><span class="pl-c">;</span> "builtin" config from C:\Users\ruturaj_k\AppData\Roaming\npm\node_modules\npm\npmrc</span>

<span class="pl-k">prefix</span> = <span class="pl-s"><span class="pl-pds">"</span>C:\\Users\\ruturaj_k\\AppData\\Roaming\\npm<span class="pl-pds">"</span></span>

<span class="pl-c"><span class="pl-c">;</span> node bin location = C:\Program Files\nodejs\node.exe</span>
<span class="pl-c"><span class="pl-c">;</span> cwd = C:\WINDOWS\system32</span>
<span class="pl-c"><span class="pl-c">;</span> HOME = C:\Users\ruturaj_k</span>
<span class="pl-c"><span class="pl-c">;</span> Run `npm config ls -l` to show all defaults.` here</span>

</pre></div>