It is an open-source library that is maintained by Facebook.
It uses Virtual DOM that makes the app fast.
Also, It offers a rich set of features including, Virtual DOM, One-way Data Binding, Components, JSX, Conditional Statements and many more.
Here at LinuxAPT, as part of our Server Management Services, we regularly help our Customers to perform related ReactJS queries.
In this context, we shall look into how to install ReactJS on your Ubuntu 20.04 system.
How to install ReactJS on your Ubuntu 20.04 System ?
To install ReactJS and running the respective applications on your Ubuntu 20.04 system, you need to perform the steps that follow.
1. Add the Relevant PPA Repository to your Ubuntu 20.04 System:
You need to add the NodeJS PPA repository to your Ubuntu 20.04 system since a ReactJS application can only run on your system if NodeJS is installed on your system.
The said repository can be added with the following command:
$ curl –sL https://deb.nodesource.com/setup_14.x | sudo bash -
2. Install NodeJS on your Ubuntu 20.04 System:
After that, you can install NodeJS on your Ubuntu 20.04 system with the following command:
$ sudo apt install nodejs –y
3. Check the Installed Version of NodeJS on your Ubuntu 20.04 System:
You can verify the successful installation of NodeJS on your Ubuntu 20.04 system by checking its version with the following command:
$ node –v
This will show the version of NodeJS on our Ubuntu 20.04 system.
4. Install Yarn on your Ubuntu 20.04 System:
Now you need to install Yarn on your Ubuntu 20.04 system, with the following command:
$ sudo npm install –g yarn
5. Create your First ReactJS Application on Ubuntu 20.04:
You can now create your first ReactJS application on Ubuntu 20.04 with the following command:
$ sudo npm init react-app myfirstreactapp
Alternatively, you can also create a ReactJS application with the command that follows:
$ yarn create react-app myfirstreactapp
It will take a few minutes for the successful creation of a ReactJS application.
6. Navigate to your ReactJS Project Directory:
After creating your ReactJS application successfully, you need to move to its project directory with the following command:
$ cd myfirstreactapp
7. Start your ReactJS Application in Ubuntu 20.04:
Now you need to start your ReactJS application with the command shown below:
$ npm start
It will take some time for the development server to start.
You will be able to view your ReactJS application in your default web browser by giving your localhost address followed by port number ":3000".
[Need urgent assistance in installing Software on Ubuntu Linux System ? We are available to help you. ]
This article covers the method of using ReactJS on a Ubuntu 20.04 system by installing NodeJS and required dependencies on it.
Finally, we demonstrated to you the usage of ReactJS by creating a sample application.
To install npm on Ubuntu Linux, login into your server as a sudo user and invoke the command below:
$ sudo apt install npm
Once the installation is complete, you can verify the version of npm installed using the command:
$ npm --version
To install the tool, run the following npm command:
$ sudo npm -g install create-react-app
Once installed, you can confirm the version of installed by running:
$ create-react-app --version
How to Install ReactJS on Ubuntu 20.04?
It makes it effortless to create and maintain interactive UI specifically for single-page applications.
Many developers are using it because of its flexibility, integrity, and its feature to bring Html directly into JS.
Many well-known corporations such as Facebook, Uber, and Instagram used the ReactJS framework to create interfaces.
To install npm, open up the terminal and type the following command:
$ sudo apt install npm
To verify if the installation is completed successfully, check the npm version through the command:
$ npm --version