1. INSTALL NODEJS
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - sudo apt-get install -y nodejs
2. INSTALL NPM
NPM(Node Package Manager) is needed to create a react app and it will be installed with the Nodejs installation itself. However, you can install the latest version for npm using the below command.
sudo npm install [email protected] -g
3. INSTALL REACT
Now you can install React using npm. You don’t need to worry about the complexity of React installation. create-react-app npm package will take care of it.
npm install -g create-react-app
4. CREATE A NEW REACT PROJECT
After successful installation of React, you can create a new app using create-react-app. awesome-project is the name I choose for my project
You can also combine the steps 3 and 4 with a single command using npx ( package runner tool that comes with npm 5.2+).
npx create-react-app awesome-project
Here npx will install react and creates a new app named awesome-project.
5. CHOOSING THE CODE EDITOR
You can choose your own favorite code editor for editing your project. But in my case, I choose Visual studio Code(VS code). Using the below link, you can download VS code for Ubuntu and install.
6. DIRECTING TO YOUR PROJECT FOLDER AND EDITING
Open your new project on VS code using the below command.
cd awesome-project code .
7. RUNNING YOUR APPLICATION
The app you created can be run using the command below.
This opens up a new tab on your browser with the URL below.
Have a nice code!