npm start fails because react-scripts is not found
sh: react-scripts: command not foundShort answer
npm runs scripts with node_modules/.bin on the PATH. If react-scripts is not found, it is not installed in this folder: you never ran npm install, you are in the wrong directory, or devDependencies were skipped because NODE_ENV is production. Install again with dev packages included.
Fix it fast
1Find out which cause you have
Check whether the folder has a package.json and whether the binary exists in node_modules.
ls package.json node_modules/.bin/react-scripts2Match what you see, then jump to its fix
- 1
ls: node_modules/.bin/react-scripts: No such file or directoryDependencies were never installed in this folderFix - 2
npm install finishes, but react-scripts is still missing and the project lists it under devDependenciesdevDependencies were skipped because NODE_ENV is productionFix - 3
The project was created with create-react-app and installs keep breaking on newer Node.js or ReactThe project is Create React App, which is deprecatedFix
- 1
What does the error look like?
sh: react-scripts: command not foundreact-scripts: command not found
Cause 1 of 3
Dependencies were never installed in this folder
1Check
npm run adds node_modules/.bin to PATH, so the command exists only when the package is installed locally. A fresh clone has no node_modules.
pwd
ls node_modules | head2Fix
Change into the folder that holds package.json and install the dependencies.
cd path/to/project
npm install3Verify
The binary is present and the script starts.
ls node_modules/.bin/react-scripts
npm startConfirmed by docs.npmjs.com
Cause 2 of 3
devDependencies were skipped because NODE_ENV is production
1Check
With NODE_ENV=production, npm does not install modules listed in devDependencies.
echo "$NODE_ENV"
npm config get omit2Fix
Install with dev packages included, or unset the variable before the install. A build step on a server needs them.
npm install --include=dev3Verify
The binary now exists, and the build runs.
ls node_modules/.bin/react-scripts
npm run buildConfirmed by docs.npmjs.com
Cause 3 of 3
The project is Create React App, which is deprecated
1Check
React's team deprecated Create React App on 14 February 2025 for new apps; it stays in maintenance mode, with no active maintainers.
grep -n "react-scripts" package.json2Fix
To keep working, reinstall as above. For a long-term fix, migrate to a framework such as Next.js or React Router, or to a build tool such as Vite, Parcel or Rsbuild; React links a migration guide for each.
npm install
npm start3Verify
The dev server starts while you plan the migration.
npm startConfirmed by react.dev
How do I stop it coming back?
- Run npm install after every clone and after switching branches that change package.json.
- Commit package-lock.json so installs are repeatable.
- Do not set NODE_ENV=production for the install step of a build that needs dev tools.
- Plan a move off Create React App while the project is small.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
- TaxiDexMy own multi-tenant taxi dispatch SaaS: API, dispatcher portal, driver and passenger apps, and the servers underneath.
- QistLockA NestJS and React SaaS driving an Android Device Owner agent that locks financed phones when payments lapse.
- WorkforceA field app, an admin console and a self-hosted Node.js server for push and reconciliation.
Related fixes
Web apps
React shows Attempted import error when importing a component or function
Attempted import error:
The build found the file but not the name you asked for.
2 causes, each with a fixWeb apps
AxiosError Network Error with code ERR_NETWORK in a React app
Network Error
ERR_NETWORK means the request produced no readable response.
4 causes, each with a fixWeb apps
Axios get works with a URL string but ignores the object passed as the second argument
The server log shows a GET with no query string
axios.get takes a URL and an optional config object.
3 causes, each with a fixWeb apps
Can't resolve '../axios' in a React project
Module not found: Error: Can't resolve '../axios'
A path that starts with ./ or ../ is a file path, not the axios package.
3 causes, each with a fixWeb apps
Axios returns 401 from a React app but the login works elsewhere
Error: Request failed with status code 401
A 401 means the server received the request without valid credentials.
3 causes, each with a fixWeb apps
An axios call never finishes when the API server stops answering
code: 'ECONNABORTED'
Axios has no timeout unless you give it one: the default is 0, which means wait forever.
3 causes, each with a fix