Task 1 - Setting up the development machine
First things first. To start developing with react-native, lets first set up our development machine by installing the prerequisites, dependencies and required tools.
Just as a heads up, I am using Windows 10 machine, so this guide will be geared more towards windows environment. In case you have mac, not to worry, most of the dependencies should be very similar and React-native docs has a detailed ‘Getting started’ guide to help installing the dependencies for Mac and Linux as well.
Below are the dependencies we need to install.
- Java SDK (latest version) — a prerequisite for Android Studio
- NodeJS — for javascript module package manager.
- Python 2
- Android Studio.
To install the above dependencies, we’ll use chocolatey, a package manager for Windows applications. So let’s first install chocolatey.
Installing chocolatey
Open command prompt with Admin privileges and type the following command (see https://chocolatey.org/install to see the prerequisites and other options for installing chocolatey.)
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
Run the above command from Command prompt
The above command will start downloading and installing Chocolatey. Once the installation is complete, the screen should be something like below:
Installing Node JS
With command prompt opened with ‘Administrator privileges’, run the below command to install NodeJS
choco install nodejs.install
When prompted for confirmation to run the script to install nodejs, enter ‘Y’ for Yes and allow the installation to complete
Installing Python 2
With command prompt opened with ‘Administrator privileges’, run the below command to install Python 2
choco install python2
When prompted to confirm running the script to install python 2, enter ‘Y’ for Yes and allow the installation to complete
Installing Java JDK
With command prompt opened with ‘Administrator privileges’, run the below command to install jdk8 (as of writing of this story, the latest jdk version is 8, you may have some other higher version available as latest jdk version, always download the latest version)
choco install jdk8
When prompted for confirmation to run the script to install jdk8, enter ‘Y’ for Yes and allow the installation to complete
Now that we got node, python and jdk installed on our development machine, we’ll install Android Studio as our next task.
Install yarn and GIT
choco install yarn
choco install git.install
If you are working on a corporate machine, you are probably secured by a proxy firewall, for this run
yarn config set strict-ssl false