Setup React Development on Windows
Setting up React on Windows requires installing Node.js and choosing the right development tools. This guide covers the complete setup process.
Prerequisites
Install Node.js and NPM
Method 1: Official Installer (Recommended)
- Download from nodejs.org
- Download the LTS version (Long Term Support)
- Run the installer and follow the wizard
- Restart your computer after installation
Method 2: Using Chocolatey
If you have Chocolatey installed:
choco install nodejsMethod 3: Using Winget
Windows 10/11 users can use Winget:
winget install OpenJS.NodeJSVerify Installation
Open Command Prompt or PowerShell:
node --version
npm --versionCreate React App
Using Create React App
npx create-react-app my-react-app
cd my-react-app
npm startYour browser will open to http://localhost:3000
Using Vite (Faster Development)
npm create vite@latest my-react-app -- --template react
cd my-react-app
npm install
npm run devDevelopment Environment
Visual Studio Code
- Download from code.visualstudio.com
- Install VS Code
- Install these essential extensions:
- ES7+ React/Redux/React-Native snippets
- Prettier - Code formatter
- ESLint
- Auto Rename Tag
- Live Server (for static files)
Windows Terminal (Recommended)
Install from Microsoft Store for better terminal experience with tabs and multiple shells.
Git for Windows
Install Git from git-scm.com
Browser Developer Tools
Install React Developer Tools:
Environment Configuration
Windows PATH Issues
If Node.js commands aren’t recognized:
- Search for “Environment Variables” in Start Menu
- Click “Edit the system environment variables”
- Click “Environment Variables”
- Add to PATH:
C:\Program Files\nodejs\C:\Users\YourUsername\AppData\Roaming\npm
Using PowerShell Profiles
Create a PowerShell profile for aliases and shortcuts:
# Open PowerShell profile
notepad $PROFILE
# Add useful aliases
Set-Alias -Name npm-start -Value "npm start"
Set-Alias -Name npm-build -Value "npm run build"Package Management
Configure NPM
# Set default npm directory to avoid permission issues
npm config set prefix "C:\Users\%USERNAME%\npm-global"Add the npm-global folder to your PATH.
Yarn Alternative
Install Yarn as an alternative package manager:
npm install -g yarnDevelopment Tools
React Developer Tools CLI
npm install -g react-devtoolsAdditional Useful Packages
# For development tools
npm install -g nodemon
npm install -g live-server
# For React Native (if needed)
npm install -g @react-native-community/cliCommon Issues and Solutions
Permission Errors
If you encounter EACCES errors:
# Clear npm cache
npm cache clean --force
# Use PowerShell as AdministratorPort Already in Use
# Find process using port 3000
netstat -ano | findstr :3000
# Kill the process
taskkill /PID <PID_NUMBER> /FNode.js Version Issues
Consider using NVM for Windows to manage multiple Node.js versions:
# Install NVM4W from GitHub
# https://github.com/coreybutler/nvm-windows
nvm install 18
nvm use 18Sources
For other platforms, check our React Linux setup or React macOS installation.