6

Introduction

I'm attempting to create a Hello World style program with React Native 0.63.3 using the official docs. I'm using to the React Native CLI Quickstart path in that link.

What I've Done So Far

I've gotten to the section:
Running your React Native application
Step 1: Start Metro

And I've run:

npx react-native start --verbose

And I get the following output:

               ######                ######               
             ###     ####        ####     ###             
            ##          ###    ###          ##            
            ##             ####             ##            
            ##             ####             ##            
            ##           ##    ##           ##            
            ##         ###      ###         ##            
             ##  ########################  ##             
          ######    ###            ###    ######          
      ###     ##    ##              ##    ##     ###      
   ###         ## ###      ####      ### ##         ###   
  ##           ####      ########      ####           ##  
 ##             ###     ##########     ###             ## 
  ##           ####      ########      ####           ##  
   ###         ## ###      ####      ### ##         ###   
      ###     ##    ##              ##    ##     ###      
          ######    ###            ###    ######          
             ##  ########################  ##             
            ##         ###      ###         ##            
            ##           ##    ##           ##            
            ##             ####             ##            
            ##             ####             ##            
            ##          ###    ###          ##            
             ###     ####        ####     ###             
               ######                ######               
                                                          
debug Checking for a newer version of React Native
debug Current version: 0.63.3
debug Cached release version: 0.60.0
debug Checking for newer releases on GitHub
                 Welcome to React Native!
                Learn once, write anywhere



To reload the app press "r"
To open developer menu press "d"

debug Latest release: 0.60.0

Pressing "r" gives the following:

No apps connected. Sending "reload" to all React Native apps failed. Make sure your app is running in the simulator or on a phone connected via USB.
info Reloading app...

Pressing "d" gives the following:

warn No apps connected. Sending "devMenu" to all React Native apps failed. Make sure your app is running in the simulator or on a phone connected via USB.
info Opening developer menu...

Question

How do I successfully run and finish the Metro process so that I can run my React Native application?

karobar
  • 1,250
  • 8
  • 30
  • 61
  • 2
    you also need to start with an emulator (npx react-native ios) or (npx react-native android) – Denis Tsoi Nov 07 '20 at 21:25
  • 1
    Oh nice! Got this working using `npx react-native run-android`. I'll let you answer this question if you want the rep, otherwise I'll self-answer soon. – karobar Nov 07 '20 at 21:34
  • This documentation isn't stellar. I always wait for a step to finish before moving on to the next and I didn't know that Metro runs continuously in the background. There isn't any output of the command that screams out to me that everything is working as intended. – karobar Nov 07 '20 at 21:37
  • thanks! - answer below – Denis Tsoi Nov 07 '20 at 22:40

1 Answers1

6

With npx react-native start, you're running the build, however, to run the application, you'll need to choose to run either on android or on ios. source:

android:

npx react-native run-android

ios: (mac)

npx react-native run-ios
Denis Tsoi
  • 9,428
  • 8
  • 37
  • 56