Issue
I have a react native web app. And after I do expo start. I choose for w-web. But then I get this error:
] 10%Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:68:19)
I am using node.js version v20.10.0.
And my package.json file looks like:
"scripts": {
"start": "expo start, react-app-rewired start --openssl-legacy-provider ",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject",
"lint": "eslint . --ext .js",
"postinstall": "patch-package",
"build": "SET NODE_OPTIONS=--openssl-legacy-provider && react-scripts build",
"start-webpack": "webpack-dev-server --mode production --open"
},
Question: how to resolve the error: error:0308010C:digital envelope routines::unsupported
Solution
The error caused by version incompatibility between node.js and OpenSSL. And one way to solve it is using a flag called --openssl-legacy-provider
that can setup in package.json.
"scripts": {
"start": "expo start --openssl-legacy-provider",
...
}
If encountering error like;
Error: Cannot find module 'expo/config'
Make sure expo
already installed in project by running npm install expo
or yarn add expo
.
If done already and still error check the module reference. You should use require('@expo/config')
not require('expo/config'). You can find the file at "AppData\Roaming\npm\node_modules\expo-cli\node_modules@expo\webpack-config\webpack\env" (like on this case).
Answered By - Keyboard Corporation
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.