npm ERR! code ERR_SSL_DECRYPTION_FAILED_OR_BAD_RECORD_MAC

Viewed 3700

I tried to create React app in VS Code by using below code. I got this error "npm ERR! code ERR_SSL_DECRYPTION_FAILED_OR_BAD_RECORD_MAC" Node version: v14.18.1 npm version: 8.1.0 OS: windows 10 VS code: 1.16.0

PS D:\React-Projects> npx create-react-app first-app

Creating a new React app in D:\React-Projects\first-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_DECRYPTION_FAILED_OR_BAD_RECORD_MAC npm ERR! 10796:error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac:c:\ws\deps\openssl\openssl\ssl\record\ssl3_record.c:677: npm ERR!

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\bizwe\AppData\Local\npm-cache_logs\2021-10-16T08_13_20_686Z-debug.log

Aborting installation. npm install --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 first-app/ from D:\React-Projects Done.

I tried all solutions given in stack overflow, but none of them is worked, Anybody help me please.

5 Answers

Type npm set strict-ssl false in the terminal. I have tried everything found over internet. Nothing worked until this. But watch out since this has security issue.

Read this for further info : Fixing ssl certficate error

The Fix:-

Just change the settings of the windows defender firewall.

It applies to all operating systems like windows, Linux, MacOS. Here is the sample in windows for checking window security image

Make sure that in window security all are checked

npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm ERR! code ERR_SSL_DECRYPTION_FAILED_OR_BAD_RECORD_MAC
npm ERR! 7828:error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac:c:\ws\deps\openssl\openssl\ssl\record\ssl3_record.c:677:
npm ERR! 

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\CODER\AppData\Local\npm-cache\_logs\2022-08-29T15_40_10_455Z-debug-0.log

solution to the problem

It works in my case. There are some window security issues. Please make sure that you have all green checks on the window security as well as the window firewall.

I hope this could help. I use a MAC. i found out today that i was on a 3G network. I switched to 4G, ran my network speed and got to at least 4mb per seconds download speed. It worked when i tried again, maybe you can do that. I got a proxy error with 3G.

Follow the docs

npm create-react-app mp-app

Related