How to create a new React.js project on Windows:

Step 1: Install Node.js

  1. Download Node.js: Go to the Node.js official website.
  2. Install Node.js: Download the LTS version and install it. During installation, ensure you check the box to add Node.js to your system PATH.

Step 2: Install npm (Node Package Manager)

  • npm comes with Node.js. To confirm its installation, open the Command Prompt or PowerShell and run:
node -v
npm -v
  • This will show the installed versions of Node.js and npm.

Step 3: Install create-react-app Globally (Optional)

You can globally install create-react-app to simplify project setup:

npm install -g create-react-app

Step 4: Create a New React Project

  1. Open the Command Prompt or PowerShell and navigate to the folder where you want to create your project:
cd path/to/your/folder

2. Create a React project by running:

npx create-react-app testproject

Step 5: Navigate to Your Project Folder

cd testproject

Step 6: Start the Development Server

Run the following command to start your React app:

npm start

Step 7: Open the App in Your Browser

Once the server starts, it will automatically open the app in your default browser at http://localhost:3000. If it doesn’t, you can manually visit that URL.

Keep Learning 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *