๐Ÿง‘โ€๐Ÿ’ป React Native CLI for Linux

๐Ÿง‘โ€๐Ÿ’ป React Native CLI for Linux

For Debian Based Distros

ยท

3 min read

For the setup of environment of "React Native" on the Debian based distros you have to follow the following steps .

This part of the setup is only for the general installation 
without any errors.
  • First you need to visit this VoltaJs to install node from it (I am suggesting VoltaJs because its a good version control for node versions. )

    OR

    You can follow these commands to install VoltaJs and then Node

      # install Volta
      curl https://get.volta.sh | bash
    
      #To execute the paths in Bashrc
      source ~/.bashrc
    
      # install Node
      volta install node
    
      # Check the Version of node
      node --version
    
  • Then after the installation of node you need to install the sdk man from this website SDKman to install JAVA from it (I am suggesting SDKman because its a good version control for java versions.)

    OR

      # To install SDKman in your system
      curl -s "https://get.sdkman.io" | bash
    
      # To execute the paths in Bashrc
      source ~/.bashrc
    
      # To check the versions of JAVA 
      sdk list java
    
      # To install the JAVA version 17.0.9(recommended stabel)
      sdk install java 17.0.9-ms
    
  • After the installation of JAVA you need to install Android Studio you can either install it from Android Studio

  • After the installation of Android Studio you need to install all the sdk tools as indicated in the following images (ticked one's only)

  • After the installation of the following tools now you need to add the path of Android Studio and its Sdk files into your ~/.bashrc copy the following path into your ~/.bashrc

      export ANDROID_HOME=$HOME/Android/Sdk
      export PATH=$PATH:$ANDROID_HOME/emulator
      export PATH=$PATH:$ANDROID_HOME/platform-tools
    
  • After adding the path and full installation of node and java you can now create a react-native project by typing the following command .

      #Before writting this command you need get into the 
      #directory of your liking and then use the following command
      npx react-native@latest init AwesomeProject
    
  • Now you need to open Android Studio with the {Folder you created with the command present above} and select android folder from the folder like its shown in the image below and then click on the OK and then let the Android Studio build the Gradel (Gradel build will take some time be patient).

  • After the Gradel build it will take time to set the Indexing don't close the Android Studio just after Gradel Build or the app may crash if you do so .

Your setup for react-native has been done for Debian based Distros

Now you can simply get into your directory and type

# Please use this command only after getting into ypur project directory and it must conatine a file named with package.json
 npm start

Enjoy!!!

ย