Getting Started

React Environment Setup

Set up Node.js, package manager, and a React project with modern tooling for development.

Prerequisites

Install the following before starting:

  • Node.js LTS (18+ recommended)
  • npm (comes with Node) or pnpm/yarn
  • VS Code or another editor
  • Git

Check installation:

bash
node -v
npm -v
git --version

Create a new React project

Use Vite for fast development and builds:

bash
npm create vite@latest my-react-app -- --template react-ts
cd my-react-app
npm install
npm run dev

Open the URL printed in terminal (usually http://localhost:5173).

Important npm scripts

bash
npm run dev      # start dev server
npm run build    # production build
npm run preview  # preview build output
npm run lint     # lint checks
  • ESLint extension
  • Prettier extension
  • TypeScript language support
  • Path IntelliSense

Common setup issues

IssueFix
node not foundReinstall Node and restart terminal
Port already in useRun dev server with another port
Dependency install failsDelete node_modules and lockfile, reinstall

Your environment is ready. Next, learn project structure and file organization.