linux

Installing ReactJS on Ubuntu

 

Developer Facebook in the year 2011, React (also called ReactJS) is a Javascript library used to create fast and interactive user interfaces. At the time of writing, it is the most popular Javascript library for user interface development. React moves colleagues – Angular and Vue JS in terms of functionality and popularity.

Its popularity is due to its flexibility and simplicity, making it the first choice in the development of mobile and web applications. More than 90,000 use of the sites React including technical giants such as Facebook, Netflix, Instagram, Airbnband Twitter list a few.

In this article, you will learn how to install ReactJS on Ubuntu 20.04 and Ubuntu 18.04.

Step 1: Install NPM on Ubuntu

Let’s get started React JS installing npm – Abbreviation for node packet management, there are two things. First, it is a command line tool used to interact with Javascript packages that allows users to install, update, and manage Javascript tools and libraries.

Second, npm is an open source online software registry that hosts 800,000 Node JS packages. Npm is free and you can easily download publicly available applications.

 

Install npm on Ubuntu Linux, log in to your server a sudo user and call the command below:

$ sudo apt install npm

When the installation is complete, you can check the version npm installed with the command:

$ npm --version

6.14.4  [Output]

The latest version at the time of this writing is v6.14.4 as described in the output.

Installation npm also install node.js and you can confirm the version node installed with the command:

$ node --version

v10.16.0  [Output]

Step 2: Install the Create-Respond application

create-respond-application is a utility that allows you to configure all the necessary tools React Application. It saves a lot of time and energy by setting everything from scratch and giving you the lead you need.

Follow the steps below to install the tool npm command:

$ sudo npm -g install create-react-app
Install the Create React application tool
Install the Create React application tool

After installation, you can confirm the installed version by running:

$ create-react-app --version

4.0.1  [Output]

Step 3: Create and launch the First React application

Creating a React the application is quite simple and straightforward. We are going to create a response application called tecmint application as follows.

$ create-react-app tecmint-app

It takes about 5 minutes to install all the packages, libraries, and tools your application needs. Some patience is helpful.

Create a React application
Create a React application

If the application was created successfully, you will receive a notification below with basic commands that you can run to start managing the application.

Summary of React
Summary of React

Go to run the application application directory

$ cd tecmint-app

Then run the command:

$ npm start

After all, you’ll get the result below that shows you how to use the app in your browser.

Run the React App
Run the React App

Launch your browser and browse the IP address of your server

http://server-ip:3000
Open the React application in a browser
Open the React application in a browser

This indicates that the default value React the application is running. In this guide, we have successfully installed React JS and created the application React.

If you appreciate what we do here at TecMint, you need to consider:

TecMint is the fastest growing and most trusted community site for all kinds of Linux articles, guides, and books online. Millions of people visit TecMint! Search or browse thousands of published articles that are accessible to everyone.

Related Articles

Leave a Reply

Your email address will not be published.

Back to top button