Issue 1:
Installing any package causes this error. I am currently using Windows 10 and NodeJS v17.

Issue 2:
Is there an existing issue for this?

I have searched the existing issues

This issue exists in the latest npm version

I am using the latest npm

Current Behavior

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.

PS E:\VS projs\react-app> 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.

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.

There's still more to this

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 :( .

2022-01-31T09_34_56_431Z-debug-0.log

Expected Behavior

Expected to install the required packages and create a react app.

Expected to install global modules without any error

Expected output

Steps To Reproduce

Open Terminal / Command Prompt

Type npm install -g nodemon or npx create-react-app my-app

Fetches some packages.

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...

Then suddenly logs an error stoping the install.

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!

and sometimes

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

Environment

npm: v8.4.0

Node.js: v17.4.0

OS Name: Windows 10 Pro Build 9043.1503 Version 21H1

npm config:

npm config ls `; "builtin" config from C:\Users\ruturaj_k\AppData\Roaming\npm\node_modules\npm\npmrc

prefix = "C:\\Users\\ruturaj_k\\AppData\\Roaming\\npm"

; 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