Install React — React Technical Interview Questions & Answers
Install React
Install React
- To run React you need Node.js (npm or pnpm). Then you scaffold an app. Today that is usually Vite: npm create vite@latest shop -- --template react. cd shop, npm install, npm run dev. The terminal prints a localhost URL. Browser shows the starter page — install worked.
- Older tutorials say create-react-app. Know the name. Don’t start a new 2026 project on CRA; it is effectively unmaintained. Vite (or Next.js if you need SSR) is the honest answer.
- Trap: installing react in a random folder without a bundler and wondering why import fails in a plain HTML file. React JSX needs a build step (or a rare CDN+Babel demo). Real work uses Vite/Next.
- Install React — output: three steps. Node first. Then a Vite React app. Browser opens the dev URL.
Technical Interview Tip: Node → Vite → npm run dev → localhost.
Code Examples for Install React
Example
// Install React
console.log("1. install Node LTS");
console.log("2. npm create vite@latest shop -- --template react");
console.log("3. cd shop && npm install && npm run dev");
Install React — output: three steps. Node first. Then a Vite React app. Browser opens the dev URL.
How to Explain Install React to an Interviewer
What must be installed before npm create vite?
Node.js
What command runs the dev server?
npm run dev