A well-liked JavaScript library for creating user interfaces is called React. It is maintained by Facebook and is open-source. A package manager called Yarn is used in JavaScript projects to manage dependencies. We’ll show you how to install React using Yarn in this article.
You must have Node.js installed on your PC before installing React. JavaScript can be run on the server-side using Node.js, a JavaScript runtime environment. Node.js may be installed and downloaded from the official website.
Installing Yarn comes after Node.js has been set up on your computer. Run the following command in your terminal to install Yarn:
“`
yarn npm install
“`
Create a New React Project in Step 3
Use the create-react-app tool to start a new React project. A new React project is created using this tool with all the required files and dependencies. In your terminal, use the following command to start a new React project:
“`
”’
Install dependencies in Step 4
”’
yarn install
”’
Start the development server in step five
”’
yarn start
”’
What’s up, PM2?
”’
”’
pm2 start app.js
”’
Your Node.js application will be launched using this command and controlled by PM2. Run the following command to monitor your application as well: ”’
pm2 monit
”’
Nohup file: What is it?
A command can be executed in the background even after the terminal is closed by using the nohup command. Even if you close the terminal or log out of the system after running a command with nohup, it won’t be terminated. The command’s output will be sent to a file called nohup.out.
”’
&
”’
”’
nohup and
”’
The output of the Node.js application will be routed to the nohup.out file by this command, which will launch it in the background. By launching the nohup.out file, you can examine the command’s output.