If you’re working on a React project and suddenly see:
sh: react-scripts: command not found
Don’t panic — this is a very common issue, especially in projects created with Create React App.
This guide breaks down:
- ✅ Why this happens
- 🧨 Common mistakes
- ⚡ Proven fixes
- 🚀 Long-term solutions
🧠 Why this error happens
This error means your system can’t find the react-scripts binary.
react-scripts is the tool that powers:
npm startnpm buildnpm test
If it’s missing or broken → your app won’t run.
🧨 Common causes
Here’s what usually triggers the issue:
- ❌
node_modulesfolder is missing or corrupted - ❌
react-scriptsnot installed in dependencies - ❌ Wrong working directory
- ❌ Mixing package managers (
npm,yarn,pnpm) - ❌ Broken install or cache
- ❌ Node version incompatibility
⚡ Fix #1: Reinstall dependencies (Most Effective)
Start with a clean slate:
rm -rf node_modules package-lock.json
npm install
npm start
👉 This alone fixes most cases.
📦 Fix #2: Install react-scripts manually
Check your package.json:
"dependencies": {
"react-scripts": "5.0.1"
}
If it’s missing:
npm install react-scripts
📁 Fix #3: Make sure you're in the right folder
Run:
ls
You should see:
package.jsonsrc/public/
If not → navigate to your project:
cd your-project-name
🧪 Fix #4: Run with npx
Quick workaround:
npx react-scripts start
👉 This bypasses local binary issues.
⚙️ Fix #5: Run the binary directly
On Mac/Linux:
./node_modules/.bin/react-scripts start
If this works → your PATH is misconfigured.
🔥 Fix #6: Clear npm cache (if installs fail)
npm cache clean --force
npm install
🧠 Fix #7: Check Node version
Some versions break compatibility.
node -v
Recommended:
- Node 18, 20, 22, 25
Use a version manager if needed.
⚠️ Fix #8: Don’t mix package managers
If you see:
-
package-lock.json→ usenpm -
yarn.lock→ useyarn
🚫 Don’t mix them — it causes dependency conflicts.
🚀 The bigger issue (and better solution)
Let’s be real:
Projects using Create React App and react-scripts are aging.
Modern alternatives are faster and more reliable:
- ⚡ Vite
- 🔥 Next.js
🆕 Bonus: Create a new app with Vite
If you’re starting fresh:
npm create vite@latest my-app
cd my-app
npm install
npm run dev
👉 Much faster startup, fewer issues.
🧠 Final thoughts
This error isn’t really about React — it’s about your environment setup.
Once you understand that:
You stop guessing… and start fixing things fast.
💬 Have you hit this bug?
Drop your setup (Node version, package manager, error logs), and I’ll help debug it with you 👇

Top comments (0)