Photo by Lautaro Andreani on Unsplash
Creating a react app with CRA (Create React App) on Deepin Linux 20.9 apricot via the command-line
React.js
React
, also known as React.js or ReactJS, is an open-source JavaScript library for building user interfaces (UIs) and web applications.
Developed and maintained by Facebook, React has gained widespread popularity in the web development community for its efficiency, flexibility, and component-based architecture.
Note
My articles are constantly evolving, and I welcome any feedback, corrections, or suggestions you may have. Please don't hesitate to share them with me, and I'll be grateful for your input.
Give me a shout or add me:
Let's get down to business
shall we?
Check your OS
This step is just to make sure you have Linux Mint or a **Ubuntu-**based Linux distribution.
cat /etc/os-release
lsb_release -a
uname -a
Output
Install Google Chrome
In this article, you can check its installation process with wget and a Debian file format. Check it out.
Install Node.js
In this article, you can check its installation process with curl
and nvm
. Check it out.
Install CRA
npm install -g create-react-app
Output
Create React App (CRA) is an official command-line tool provided by the React team and the Facebook development community. It simplifies the process of setting up and bootstrapping new React.js applications.
CRA generates a complete and well-structured React project with all the essential files, configurations, and development tools preconfigured, allowing developers to start building React applications quickly without the need to manually set up the project structure.
Create react app
npx create-react-app my-react-app
Replace my-react-app
with your actual app's name.
Output
The command npx
is used instead of npm
when creating a new React project with Create React App (CRA) because npx is a package runner tool that comes with npm (Node Package Manager) and is designed to make it easier to run packages that are not globally installed on your system.
In summary, the use of npx
when creating React projects with CRA is a best practice that leverages the ability to run packages without global installations, making it easier to manage and use tools like Create React App while avoiding potential version conflicts.
Navigate to the project folder
cd my-react-app/
Start the development server
npm start
In order to start the development server and run your React application locally, use the previous command.
Output
Check the up-and-running page
Stop the server (optional)
In order to finish, just press:
CTRL + C
Done
Celebrate
Let's become friends
Final thoughts
Thank you for reading this article.
If you have any questions, thoughts, suggestions, or corrections, please share them with us.
We appreciate your feedback and look forward to hearing from you.
Feel free to suggest topics for future blog articles. Until next time!