DEV Community

Bharath kumar
Bharath kumar

Posted on

How to install react

✅ Step 1: Install Node.js & npm

React requires Node + npm.
open terminal in linux
enter the code :


sudo apt install nodejs
Enter fullscreen mode Exit fullscreen mode

after installation complited and next enter the code:


sudo apt install npm
Enter fullscreen mode Exit fullscreen mode

check version node -v and npm -v
✅ Step 2: Install React using Vite (Recommended – Fast & Modern)

  1. Install Vite tool
npm create vite@latest my-react-app
Enter fullscreen mode Exit fullscreen mode
  1. When asked:

Select React

Select JavaScript

  1. Open the project
cd my-react-app

Enter fullscreen mode Exit fullscreen mode
  1. Install dependencies
npm install

Enter fullscreen mode Exit fullscreen mode
  1. Run the project
npm run dev

Enter fullscreen mode Exit fullscreen mode

Now open the browser and go to:

http://localhost:5173

Enter fullscreen mode Exit fullscreen mode

🎉 React app is running!

Top comments (0)