xxxxxxxxxx
For react native with expo add this line inside scripts in packages.json:
"start2": "NODE_OPTIONS=--openssl-legacy-provider expo start"
and use 'npm run start2' to run the project
Example:
"scripts": {
"start": "expo start",
"start2": "NODE_OPTIONS=--openssl-legacy-provider expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web"
},
For normal react:
go to packages.json then, add this "--openssl-legacy-provider" to the scripts
BEFORE (ANTES DE EDITAR)
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build"
}
AFTER (LUEGO DE EDITAR)
"scripts": {
"start": "react-scripts --openssl-legacy-provider start",
"build": "react-scripts --openssl-legacy-provider build"
}
xxxxxxxxxx
# adding this to your env
export NODE_OPTIONS=--openssl-legacy-provider
Add `export SET NODE_OPTIONS=--openssl-legacy-provider`in the start or serve command
xxxxxxxxxx
"scripts": {
"start": "export SET NODE_OPTIONS=--openssl-legacy-provider && react-scripts start",
"build": "export SET NODE_OPTIONS=--openssl-legacy-provider && react-scripts build"
}
replace start script with this
"scripts": {
"start": "react-scripts --openssl-legacy-provider start",
}
xxxxxxxxxx
for vuejs can install nvm (node version Manager)
1. curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
2. Open your project
3. Open the terminal in your project
4. Run this command nvm install 16.13.0 or any older version
5. After the installation is completed, run nvm use 16.13.0