Home » How to install React Native on Windows (Part 1)

How to install React Native on Windows (Part 1)

by Pring
How to install React Native on Windows

Introduction:

This posts is about how to install and configure React Native CLI environment.
You need to install Nodejs, Watchman, Xcode, etc to develop the app by react-native.

I. Install React Native on Windows (Part 1) by step by step.

To install React Native on Windows. Follow these steps:
Step 1. Install Chocolatey.
Step 2. Install NodeJS.
Step 3. Install Python.
Step 4. Install React Native CLI.
Step 5. Install JDK.
Step 6. Install Android Studio, Android Studio SDK Configuration, Configure Android Studio Environment Variable.

You can see details of Video on How to Install Python on Windows as below.
[Sorry, the video we will update later]

Or you also can see details as below.

Step 1. Install Chocolatey.

Chocolatey is a package manager on Windows to install and manage packages.
We can install packages simply on Windows via Chocolatey.

To installing Chocolatey, open Command Prompt as Administrator, and execute the command below.
How to install React Native on Windows

On Command Prompt, execute the command below:

@“%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command “iex ((New-Object System.Net.WebClient).DownloadString(‘https://chocolatey.org/install.ps1‘))” && SET “PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin”

Sample output :
How to install React Native on Windows

To check Chocolatey is installed well, on Command Prompt, execute the command below:

choco –version

#Sample output:
You can see Chocolatey version on the screen.
How to install React Native on Windows

 

Step 2. Install NodeJS.

The react-native is javascript, so you need to install Nodejs that is javascript runtime.
To installing Nodejs, open Command Prompt as Administrator, then execute Chocolatey command below to install Nodejs.

choco install -y nodejs.install

#Sample output :
How to install React Native on Windows

C:\WINDOWS\system32>choco install -y nodejs.install
Chocolatey v0.10.15
Installing the following packages:
nodejs.install
By installing you accept licenses for the packages.
Progress: Downloading nodejs.install 15.12.0... 100%

nodejs.install v15.12.0 [Approved]
nodejs.install package files install completed. Performing other installation steps.
Installing 64 bit version
Installing nodejs.install...
nodejs.install has been installed.
  nodejs.install may be able to be automatically uninstalled.
Environment Vars (like PATH) have changed. Close/reopen your shell to
 see the changes (or in powershell/cmd.exe just type `refreshenv`).
 The install of nodejs.install was successful.
  Software installed as 'msi', install location is likely default.

Chocolatey installed 1/1 packages.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

To check Chocolatey is installed well, on Command Prompt, execute the command below:

node -–version

#Sample output:
You can see Chocolatey version on the screen.
How to install React Native on Windows

After Nodejs is installed, Node Package Manager (npm) is also installed. To check npm is installed, enter the command below:

npm –version

#Sample output:

C:\WINDOWS\system32>npm –version
npm notice
npm notice New minor version of npm available! 7.6.3 -> 7.7.5
npm notice Changelog: https://github.com/npm/cli/releases/tag/v7.7.5
npm notice Run npm install -g npm@7.7.5 to update!
npm notice
7.6.3

Step 3. Install Python.

The React Native build system uses Python. On Windows, this is required. But, on Mac is not required, because the Python is basically installed.

To installing Python, open Command Prompt as Administrator, then execute Chocolatey command below to install Python.

choco install -y python2

#Sample output :
How to install React Native on Windows

After installing, to check Python version. You re-open the Command Prompt(cmd), then enter the command bellow:

python –version

#Sample output:

C:\WINDOWS\system32>python –version
Python 2.7.18

Step 4. Install React Native CLI.

To install React Native CLI to develop the app by react-native. on the Command Prompt(cmd), execute npm command below :

npm install -g react-native-cli

#Sample output:
How to install React Native on Windows

After installing, to check React Native CLI version. You open the Command Prompt(cmd), then enter the command bellow:

react-native –version

#Sample output:
If React Native CLI is installed success, you can see React Native version on the screen.

C:\WINDOWS\system32>react-native –version
react-native-cli: 2.0.1
react-native: n/a – not inside a React Native project directory

Step 5. Install JDK.

You need to install Java Development Kit (JDK) to develop Android app with react-native. Open Command Prompt as Administrator, then execute JDK with the command below :

choco install -y jdk8

#Sample output:
How to install React Native on Windows

After installing, to check JDK version. You open the Command Prompt(cmd), then enter the command bellow:

java -version

#Sample output:
If JDK is installed success, you can see JDK version on the screen.

C:\WINDOWS\system32>java -version
java version “1.7.0_05”
Java(TM) SE Runtime Environment (build 1.7.0_05-b06)
Java HotSpot(TM) 64-Bit Server VM (build 23.1-b03, mixed mode)

Step 6. Install Android Studio, Android Studio SDK Configuration, Configure Android Studio Environment Variable.

Since the post is too long, we have created a new post. Sorry!!!
How to install React Native on Windows (Part 2)

II. Conclusion.

In this tutorial, we’ve installed React Native on Windows. If you hit a problem or have feedback, leave a comment below.


Install React Native on Windows is complete. Wish you success and luck.
Thanks and best regards!
— Pring —

Related Articles

2 comments

How to install React Native on Windows (Part 2) - DevOpsIO.com March 28, 2021 - 7:04 am

[…] March 28 2021 Top Posts How to install React Native on Windows (Part… How to install React Native on Windows (Part… Linux: How to configure the proxy on Linux Linux: Using X11 Forwarding/Xming X Server with PuTTY […]

Reply
ito March 29, 2021 - 7:19 am

Thanks

Reply

Leave a Comment