Every developer hits weird errors. The difference between struggling for hours vs fixing things fast comes down to pattern recognition .
This post breaks down well-known bugs , why they happen, and how to fix them quicklyβespecially in projects using Create React App and the Node ecosystem.
𧨠1. react-scripts: command not found
β Error
sh: react-scripts: command not found
πΊ Info Siaran: kyl/common react npm bugs and how to fix them like a pro gd - Info Live Streaming 2026
πΊ Info Siaran: kyl/common react npm bugs and how to fix them like a pro gd - Info Live Streaming 2026
π₯ Why it happens
react-scripts isnβt installed
node_modules is missing/corrupted
Wrong project directory
β
Fix
rm -rf node_modules package-lock.json
npm install
πΊ Info Siaran: kyl/common react npm bugs and how to fix them like a pro gd - Info Live Streaming 2026
πΊ Info Siaran: kyl/common react npm bugs and how to fix them like a pro gd - Info Live Streaming 2026
If still broken:
npm install react-scripts
πΊ Info Siaran: kyl/common react npm bugs and how to fix them like a pro gd - Info Live Streaming 2026
πΊ Info Siaran: kyl/common react npm bugs and how to fix them like a pro gd - Info Live Streaming 2026
π 2. EACCES Permission Denied
β Error
EACCES: permission denied, mkdir 'node_modules/.cache'
πΊ Info Siaran: kyl/common react npm bugs and how to fix them like a pro gd - Info Live Streaming 2026
πΊ Info Siaran: kyl/common react npm bugs and how to fix them like a pro gd - Info Live Streaming 2026
π₯ Why it happens
You used sudo npm install
Files are owned by root
β
Fix
sudo chown -R $( whoami ) .
rm -rf node_modules package-lock.json
npm install
πΊ Info Siaran: kyl/common react npm bugs and how to fix them like a pro gd - Info Live Streaming 2026
πΊ Info Siaran: kyl/common react npm bugs and how to fix them like a pro gd - Info Live Streaming 2026
π« Never use:
sudo npm install
πΊ Info Siaran: kyl/common react npm bugs and how to fix them like a pro gd - Info Live Streaming 2026
πΊ Info Siaran: kyl/common react npm bugs and how to fix them like a pro gd - Info Live Streaming 2026
π¦ 3. node_modules Hell (Corrupted installs)
β Symptoms
Random errors after install
Missing packages
App wonβt start
π₯ Why it happens
Interrupted installs
Lockfile conflicts
Cache issues
β
Fix (golden reset)
rm -rf node_modules package-lock.json
npm cache clean --force
npm install
πΊ Info Siaran: kyl/common react npm bugs and how to fix them like a pro gd - Info Live Streaming 2026
πΊ Info Siaran: kyl/common react npm bugs and how to fix them like a pro gd - Info Live Streaming 2026
β οΈ 4. Version Mismatch (Node issues)
β Symptoms
Packages fail to install
Build crashes
Strange syntax errors
π₯ Why it happens
Some tools donβt support newer Node versions.
β
Fix
node -v
πΊ Info Siaran: kyl/common react npm bugs and how to fix them like a pro gd - Info Live Streaming 2026
πΊ Info Siaran: kyl/common react npm bugs and how to fix them like a pro gd - Info Live Streaming 2026
Use:
Use a version manager if needed.
π 5. Mixing Package Managers
β Symptoms
Duplicate dependencies
Lockfile conflicts
Install failures
π₯ Why it happens
Using npm + yarn together.
β
Fix
Use ONE:
package-lock.json β npm
yarn.lock β yarn
π 6. Port Already in Use
β Error
Something is already running on port 3000
πΊ Info Siaran: kyl/common react npm bugs and how to fix them like a pro gd - Info Live Streaming 2026
πΊ Info Siaran: kyl/common react npm bugs and how to fix them like a pro gd - Info Live Streaming 2026
π₯ Why it happens
Another process is using the port.
β
Fix
lsof -i :3000
kill -9 <PID>
πΊ Info Siaran: kyl/common react npm bugs and how to fix them like a pro gd - Info Live Streaming 2026
πΊ Info Siaran: kyl/common react npm bugs and how to fix them like a pro gd - Info Live Streaming 2026
π§ͺ 7. ESLint Permission Errors
β Error
EACCES: permission denied
πΊ Info Siaran: kyl/common react npm bugs and how to fix them like a pro gd - Info Live Streaming 2026
πΊ Info Siaran: kyl/common react npm bugs and how to fix them like a pro gd - Info Live Streaming 2026
π₯ Why it happens
Same root cause: ownership issues.
β
Fix
sudo chown -R $( whoami ) .
πΊ Info Siaran: kyl/common react npm bugs and how to fix them like a pro gd - Info Live Streaming 2026
πΊ Info Siaran: kyl/common react npm bugs and how to fix them like a pro gd - Info Live Streaming 2026
β‘ 8. Module not found Errors
β Error
Module not found: Can't resolve ' xyz'
πΊ Info Siaran: kyl/common react npm bugs and how to fix them like a pro gd - Info Live Streaming 2026
πΊ Info Siaran: kyl/common react npm bugs and how to fix them like a pro gd - Info Live Streaming 2026
π₯ Why it happens
Package not installed
Wrong import path
Case-sensitive file systems
β
Fix
npm install xyz
πΊ Info Siaran: kyl/common react npm bugs and how to fix them like a pro gd - Info Live Streaming 2026
πΊ Info Siaran: kyl/common react npm bugs and how to fix them like a pro gd - Info Live Streaming 2026
Or fix import:
import Component from " ./Component " // not ./component
πΊ Info Siaran: kyl/common react npm bugs and how to fix them like a pro gd - Info Live Streaming 2026
πΊ Info Siaran: kyl/common react npm bugs and how to fix them like a pro gd - Info Live Streaming 2026
π₯ 9. Environment Variables Not Working
β Symptoms
π₯ Why it happens
In CRA, env vars must start with:
REACT_APP_
πΊ Info Siaran: kyl/common react npm bugs and how to fix them like a pro gd - Info Live Streaming 2026
πΊ Info Siaran: kyl/common react npm bugs and how to fix them like a pro gd - Info Live Streaming 2026
β
Fix
REACT_APP_API_URL = https://api.com
πΊ Info Siaran: kyl/common react npm bugs and how to fix them like a pro gd - Info Live Streaming 2026
πΊ Info Siaran: kyl/common react npm bugs and how to fix them like a pro gd - Info Live Streaming 2026
Restart dev server after changes.
π§ 10. Outdated Tooling Problems
β Symptoms
Random build errors
Slow dev server
Weird dependency issues
π₯ Why it happens
Older tools like Create React App rely on aging dependencies.
π Modern Fix (Long-Term)
Instead of constantly patching bugs:
Switch to:
Example (Vite setup)
npm create vite@latest my-app
cd my-app
npm install
npm run dev
πΊ Info Siaran: kyl/common react npm bugs and how to fix them like a pro gd - Info Live Streaming 2026
πΊ Info Siaran: kyl/common react npm bugs and how to fix them like a pro gd - Info Live Streaming 2026
π Faster, fewer bugs, better DX.
π§ Final Thoughts
Most βReact bugsβ are actually:
βοΈ environment problems, not code problems
Once you recognize patterns like:
permissions
missing dependencies
version mismatches
Youβll debug 10x faster .
π¬ What bug are you stuck on?
Drop your error below π
Iβll help you debug it step-by-step.
Top comments (0)