12

I have set up create-react-native-app as said in the react native docs. If my project name is proj, according to the docs, the commands to be run should be :

create-react-native-app proj
cd proj
npm start

But when I run create-react-native-app, I get a menu to select a blank template or the one with tabs. And instead of npm start, it says to use expo start. Why am I getting a different output compared to the docs?

Lewis Browne
  • 904
  • 7
  • 23
TheFirstMe
  • 123
  • 1
  • 1
  • 4
  • official documentation is quite different, https://github.com/react-community/create-react-native-app#quick-overview. Where did you get those steps? – Rodrigo.C Sep 24 '18 at 13:38
  • @Rod.C here https://facebook.github.io/react-native/docs/getting-started.html – TheFirstMe Sep 24 '18 at 13:40
  • 1
    I guess Facebook documentation is outdated, create-react-native-app is a script created by the community, is not an official script form Facebook. I can be wrong, but I added some links below, so you can follow the official documentation that has different steps, and the 'eject' process if you don't want to use expo – Rodrigo.C Sep 24 '18 at 13:46

3 Answers3

14

You can use:

react-native init projectName
Vikram Biwal
  • 2,618
  • 1
  • 25
  • 36
4

Official documentation indicates different steps: https://github.com/react-community/create-react-native-app#create-react-native-app

if you don't want to use Expo, just follow the eject steps: https://github.com/react-community/create-react-native-app/blob/master/EJECTING.md. Optionally you can reate

or you can create a react native app by yourself without using the create-react-native-app script. More details here, https://facebook.github.io/react-native/docs/getting-started.html#creating-a-new-application

Rodrigo.C
  • 1,123
  • 2
  • 10
  • 22
  • 1
    You are right. Once I saw the name Facebook, I didn't go to research about that topic any further. Thanks for the help :) – TheFirstMe Sep 24 '18 at 13:53
1

You can use the executable react-native package. This will not require you to install react-native as a global dependency:

npx react-native init yourProjectName

CeamKrier
  • 629
  • 7
  • 15