Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"npx react-native start" hangs

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?

like image 774
karobar Avatar asked Nov 07 '20 21:11

karobar


1 Answers

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
like image 153
Denis Tsoi Avatar answered Oct 05 '22 09:10

Denis Tsoi