React itself is just a JavaScript library, but building and running a modern React project requires Node.js โ a JavaScript runtime that lets tools run outside the browser. Installing Node.js also installs npm (Node Package Manager), which downloads and manages the libraries ("packages") your project depends on. Verify your installation:
node -v
npm -v
Vite (pronounced "veet") is the current standard tool for scaffolding and running React projects โ it starts a development server almost instantly and bundles your code efficiently for production.
npm create vite@latest my-react-app -- --template react
cd my-react-app
npm install
npm run devnpm create vite@latest: downloads and runs Vite's project generator-- --template react: tells Vite to scaffold a React (not Vue/Svelte) projectnpm install: downloads all required dependencies into anode_modulesfoldernpm run dev: starts a local development server, usually athttp://localhost:5173
For production, npm run build bundles and optimizes everything in src/ into a small, fast dist/ folder ready to deploy to a real web server.
A freshly cloned or created project's node_modules folder is either missing or empty until you run npm install. Trying npm run dev first produces confusing "module not found" errors โ always install dependencies first.
Create a new Vite + React project named practice-app, install its dependencies, and start the dev server to confirm the default welcome page loads.
npm create vite@latest practice-app -- --template react
cd practice-app
npm install
npm run dev
Q Do I have to use Vite for React?
No โ Create React App was the older standard tool, but it's no longer actively recommended. Vite is now the standard for new projects due to its much faster startup and build times.
Q What port does the Vite dev server use?
By default, Vite runs on http://localhost:5173, though it will automatically pick the next available port if 5173 is already in use.