1 00:00:00,350 --> 00:00:02,490 To get started building your React Native app, 2 00:00:02,490 --> 00:00:07,970 you'll need to install create React Native app globally using either NPM or Yarn. 3 00:00:07,970 --> 00:00:09,310 I'm going to use NPM. 4 00:00:09,310 --> 00:00:14,301 So in my terminal, I'll run the command npm install 5 00:00:14,301 --> 00:00:18,989 -g followed by create-react-native-app. 6 00:00:18,989 --> 00:00:22,920 Now it's recommended that you have Node version 6 or 7 00:00:22,920 --> 00:00:27,920 later installed in your computer and that you use npm version 3 or 4. 8 00:00:27,920 --> 00:00:29,495 You see, as I'm recording this video, 9 00:00:29,495 --> 00:00:34,700 create-react-native-app does not work with npm 5 due to bugs in npm. 10 00:00:34,700 --> 00:00:38,104 But remember, you also have the option of using a recent version of Yarn. 11 00:00:38,104 --> 00:00:44,930 Once create-react-native-app is installed, you create a new react native project 12 00:00:44,930 --> 00:00:49,010 with the command create-react-native-app, followed by the name of your project. 13 00:00:49,010 --> 00:00:56,120 So I'll navigate to my desktop and run create-react-native-app and 14 00:00:56,120 --> 00:01:00,115 I'll name my project myNativeApp. 15 00:01:01,760 --> 00:01:04,844 Running this command, begins installing the dependencies and 16 00:01:04,844 --> 00:01:06,563 files needed to build you project. 17 00:01:06,563 --> 00:01:10,141 Now it might take a little bit to complete the installation, but 18 00:01:10,141 --> 00:01:13,586 once it's complete you'll see this success in the console, 19 00:01:13,586 --> 00:01:18,045 letting you know that tour project was successfully created at this location. 20 00:01:18,045 --> 00:01:23,102 And it says that inside that directory, you can run several commands. 21 00:01:23,102 --> 00:01:27,795 These instructions list five important commands for create-react-native-app. 22 00:01:27,795 --> 00:01:33,050 Start, run iOS, run android, test, and eject. 23 00:01:33,050 --> 00:01:38,260 So, for example, the start command starts the development server, that way you 24 00:01:38,260 --> 00:01:43,790 can run and preview your app on a physical device or in iOS or android emulator. 25 00:01:43,790 --> 00:01:46,728 Now, the next who commands, run iOS and 26 00:01:46,728 --> 00:01:51,481 run android are like npm start in that they start the dev server but 27 00:01:51,481 --> 00:01:55,720 they are going to open your app in a device simulator. 28 00:01:55,720 --> 00:01:59,900 So if you have Xcode with the iOS simulator installed on your Mac, 29 00:01:59,900 --> 00:02:05,860 run iOS will start the development server and load your app in its iOS simulator. 30 00:02:05,860 --> 00:02:11,370 And run android is going to open your app on a connected android device or emulator. 31 00:02:11,370 --> 00:02:15,410 But keep in mind that this would require installing Android Studio on 32 00:02:15,410 --> 00:02:18,595 your computer, or an Android emulator like Genymotion. 33 00:02:20,230 --> 00:02:23,330 The test command starts the test runner. 34 00:02:23,330 --> 00:02:27,120 This lets you start testing your app with gest as you build it. 35 00:02:27,120 --> 00:02:32,180 And the command npm run eject will start the process of ejecting or taking 36 00:02:32,180 --> 00:02:36,450 your app out of create-react-native-app set up and build scripts, which lets 37 00:02:36,450 --> 00:02:40,760 you build using native code and completely customize your project configuration. 38 00:02:41,990 --> 00:02:46,020 You're gonna learn more about the test and eject commands in a later video. 39 00:02:46,020 --> 00:02:50,530 But for now, create-react-native-app suggest that we navigate to our new 40 00:02:50,530 --> 00:02:55,480 myNativeApp folder and run npm start to start the development server. 41 00:02:55,480 --> 00:02:56,861 So, let's do that now. 42 00:03:03,058 --> 00:03:07,156 All right, now that we're running the app, in the next video, you'll see how simple 43 00:03:07,156 --> 00:03:09,574 create-react-native-app let's you build and 44 00:03:09,574 --> 00:03:13,420 preview your app on a physical device, as well as in iOS and Android simulators.