my node and react native version
react-native -v : 2.0.1
node -v : v16.16.0
run cmd
npx react-native init Loan --version 0.68.2
or
npx react-native init Loan
its give me error like this
C:\Users\dp312>npx react-native init Loan --version 0.68.2 npm WARN config global `--global`, `--local` are deprecated. Use `--location-global` instead.
This will walk you through creating a new React Native project in C:\Users\dp312\Loan
'yarn' is not recognized as an internal or external command,
operable program or batch file. Installing react-native@0.68.2...
Consider installing yarn to make this faster: https://yarnpkg.com
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! errno ERR_SSL_DECRYPTION_FAILED_OR_BAD_RECORD_MAC
npm ERR! Invalid response body while trying to fetch https://registry.npmjs.org/react-native: 10976: error:1408F119:SSL routines: ss13_get_record: decryption failed or bad rec ord mac:c:\ws\deps\openssl\openssl\ssl\record\ss13_record.c:677: npm ERR!
npm ERR! A complete log of this run can be found in:
npm ERR!
C:\Users\dp312\AppData\Local\npm-cache\_logs\2023-02-01T12_48_16_254Z-debug-0.log
Error: Command failed: npm install --save --save-exact react-native@0.68.2
at checkExecSyncError (node: child_process:828:11)
at execSync (node: child_process: 899:15) at run (C:\Users\dp312\AppData\Roaming\npm\node_modules\react-native-cli\index.js:294:5)
at createProject (C:\Users\dp312\AppData\Roaming\npm\node_modules\react-native-cli\index.js:249:3)
at init (C:\Users\dp312\AppData\Roaming\npm\node_modules\react-native-cli\index.js:200:5) at Object.<anonymous> (C:\Users\dp312\AppData\Roaming\npm\node_modules\react-native-cli\index.js:153:7)
at Module._compile (node:internal/modules/cjs/loader: 1105:14)
at Object.Module._extensions..js (node: internal/modules/cjs/loader: 1159:10)
at Module.load (node:internal/modules/cjs/loader: 981:32) {
status: 1,
signal: null,
output: null, null, null ],
pid: 7772,
stdout: null,
stderr: null
} Command `npm install --save --save-exact react-native@0.68.2` failed.
C:\Users\dp312>
or when I try to install any lib in project with npm its give me also error but when I run yarn it's install successfully
when run yarn cmd it's working
when run npm it's give me like this error
any one can give me solution and why this error is come
I'm just reset my pc after this error is come but before reset pc it's working properly I don't know why this error is come.