Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invalid sdkVersion. Valid options are 10.0.0, 11.0.0, 12.0.0, 13.0.0

Tags:

react-native

I want to use this library:

https://github.com/react-community/create-react-native-app

but I got this error message:

Error: Invalid sdkVersion. Valid options are 10.0.0, 11.0.0, 12.0.0, 13.0.0, 14.0.0, 15.0.0, 16.0.0, 17.0.0, 18.0.0, 19.0.0, 20.0.0, 21.0.0, 22.0.0, 23.0.0, 24.0.0, 25.0.0, 7.0.0, 8.0.0, 9.0.0

connected my device galaxy S4 to my mac os and I followed this methods:

$ npm install -g create-react-native-app
$ create-react-native-app my-app
$ cd my-app/
$ npm start

on my screen device I got this error:

something went wrong 

could not load exp://172.20.10.4:19000 network not response timed out
like image 418
S.M_Emamian Avatar asked Jun 27 '18 16:06

S.M_Emamian


2 Answers

I was having code written by one of my colleagues but I faced the same problem while running it and none of the above-mentioned methods could solve it for me. Here is how I made it up and running:

npm uninstall -g expo-cli --save
npm install -g expo-cli --save
expo r -c //(r is short for start, and -c is short for --clear)

NOTE: Before the above-mentioned commands I also tried doing :

npm uninstall -g create-react-native-app
npm i -g create-react-native-app

So maybe a combination of both the approaches solved it for me.

like image 102
kapil pandey Avatar answered Nov 26 '22 20:11

kapil pandey


This is a bug for the current package of either create-react-native-app or one of the modules it consumes. We can fix this by addressing the error directly as-stated by providing an SDK version that's actually supported. Right now, v 25.0.0 is the latest.

Open the app.json and change this line (it might be higher than v 27 by the time you read this):
"sdkVersion": "27.0.0"

to this line:
"sdkVersion": "25.0.0"

Then from that directory, run npm install to re-install the correct SDK.

like image 33
kayleeFrye_onDeck Avatar answered Nov 26 '22 20:11

kayleeFrye_onDeck