How To Install React
Last Updated on : 19th Dec 2024 19:29:23 PM
Follow these steps to install :
METHOD 1 :
Step 1 : Install node js and npm
https://nodejs.org/en/download
Step 2 : install create-react-app
>npm install -g create-react-app
Step 3 : check react and node and npm installed or not with bellow command in cmd
> node -v
> npm -v
> create-react-app --version
Step 4 : CREATE A FOLDER
>react (name anything you want)
Step 5 : NOW CREATE REACT APP IN THIS FOLDER
> npm create-react-app my-project (my-project is your project name)
Step 6 : NOW run below Command in your Project through terminal
npm i web-vitals --save-dev
METHOD 2 :
Step 1 : CREATE A FOLDER
>react (name anything you want)
Step 2 : NOW CREATE REACT APP IN THIS FOLDER
> npx create-react-app my-project (my-project is your project name)
METHOD 3 :
Step 1 : CREATE A FOLDER
>react (name anything you want)
Step 2: CREATE YOUR REACT APP WITH VITE IN YOUR CREATED FOLDER(eg.react)
> npm create vite@latest
Step 3: NAME YOUR PROJECT
> myapp
Step 4: SELECT A FRAMEWORK
> REACT
Step 5: SELECT A VARIANT
> JAVASCRIPT
Step 6: INSTALL NODE MODULES
> npm i or npm install
Step 7: HOW TO RUN YOUR PROJECT
> npm run dev