I'm trying to use react-native init ABC --version 0.57.0 and it has an error. Tried to use other formats of init, but still doesn't work.
You could use the initialized project, delete the node_modules, then go into the package. json file and specify the version you want, and run npm insall again.
If anybody needs to install 0.59.x do this:
mkdir rn59cli
cd rn59cli
npm init -f
npm install react-native-cli
node_modules/.bin/react-native init Rn59SampleApp --version 0.59.10
Using yarn v1.21.1
Installing [email protected]...
yarn add v1.21.1
warning ../../package.json: No license field
info No lockfile found.
[1/4] š Resolving packages...
info Direct dependencies
āā [email protected]
$ cat Rn59SampleApp/package.json
{
"name": "Rn59SampleApp",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "16.8.3",
"react-native": "0.59.10"
},
"devDependencies": {
"@babel/core": "^7.8.4",
"@babel/runtime": "^7.8.4",
"babel-jest": "^25.1.0",
"jest": "^25.1.0",
"metro-react-native-babel-preset": "^0.58.0",
"react-test-renderer": "16.8.3"
},
"jest": {
"preset": "react-native"
}
}
Try re-installing react-native CLI
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With