node_modules directory exists. after a fresh clone, there will very likely be no
node_modules (since these are
npm install (or
yarn) to ensure all deps are downloaded.
node_modules exists, remove it with
rm -rf node_modules and then run
npm install (or
just run these commands
npm install npm start
hope this will work for you thank you
none of these solutions worked for me. i found that the problem was the directory i was creating the project in, i am not sure why but when i created the project outside of that directory it worked. my solution was changing the directory to a new one from "react/ionic" to "ionic-react". it could be that not only the project itself should be lowercase, but its parent folder as well, or it could be that the "/" in the directory name be the issue. hope this helped.
fixed it with
npm install --legacy-peer-deps
if you use npm to install and npm version is less than 7, then its npm most likey to behave in a smarter way. so, it will try to install react with its other depencies(peer deps)(higher versions if found), which will likely to break the library react. attaching --legacy-peer-deps will tell npm "not to do something new", and install whats given in package.json...
btw people seem to find yarn comfortable because this "not to install higher version if even found" is built in yarn automatically
reference: a referenced question
after spending too much time trying all the solutions above, i can say for sure:
if you ran into this issue, check your path. if the path contains any special character or spaces just rename it and make sure that the new path doesn't have any spaces or special character. then run it again .
this workaround works for me
// in your package.json replace "start": "react-scripts start" // with: "start": "node_modules/react-scripts/bin/react-scripts.js start"
i just randomly experienced this "react-scripts: command not found" error after issuing a
react-scripts build request, which was previously working just fine.
a simple reboot of my system corrected the issue.
if anyone is willing to use npm only, then run this
npm i react-native-scripts --save, then npm start or whatever the command you use
delete the package-lock.json file and then type -> npm install
like this is my debug path --> so this you will find in the console -> press on command and click on the link, you will find error line; like this:
verbose stack error: firstname.lastname@example.org start:
delete the node_module and npm i with fresh way.
go to node_module and delete jses folder and delete it, then do npm i and again start with npm start
i had issues with latest version of yarn
i've fixed it by downgrading to lower version
sudo apt-get install yarn=1.12.3-1
the solution that worked for me is below. try creating react app with this command.
create-react-app react-app --scripts-version 1.1.5
i ran into this error after renaming the directory with the
@/ symbol on macos to match the name of my npm package namespace.
when the npm command looked for installed packages in my local
node_modules, it couldn't find it due to the way macos was rewriting the directory path. after renaming the directory without
@/ i was up and running again.
just you have to restore packages to solve this issue, so just run command :
npm install or yarn install
this worked for me.
if you're using yarn:
- and then
if you're using npm:
- and then
if the above solutions don't work and you saw the below error:
npm err! the operation was rejected by your operating system. npm err! it is likely you do not have the permissions to access this file as the current user
sudo npm install
i tried every answer but cleaning my npm cache worked..
- clean cache =====> npm cache clean force.
- reinstall create-react-app =====> npm install create-react-app.
- npm install.
- npm start !!!
for me it was deleting
node_modules and then run
npm install again.
deleting package-lock.json and node_modules then npm install worked for me.
if none of the other answers work properly (after updating the npm etc). i would strongly recommend you to install the project on your desktop.
if anyone still have this problem after trying these solutions: check your project path as node has some issues working with spaced dir names. i changed all directories names that had spaces in their names and it worked perfectly.
solution idea taken from: https://npm.community/t/react-scripts-not-found/8574
i am using yarn btw
you shoundt use neither spaces neither some special caracters in you path, like for example using "&". i my case i was using this path: "d:\p&d\mern" and because of this "&" i lost 50 minutes trying to solve the problem! :/
living and learning!
if you have tried everything and nothing solved it, try to rename the directories name. react will not start if the folder's name contains uppercase letters.
just ran into this problem after installing material-ui.
solved it by simply running
npm install again.
just doing an yarn install solved the problem for me
if you are having this issue in a docker container just make sure that node_modules are not added in the .dockerignore file.
i had the same issue sh1 : react scripts not found. for me this was the solution
this boggles me time to time when i have a fresh start with create-react-app, please make sure your node_env variable is set to development not production, as devdependencies in your package.json will not be installed by npm install.
npm install --save react react-dom react-scripts
above command worked for me.
npm i --legacy-peer-deps worked for me.
i do not know specifically which operation out of the following it performed:
- installing the peer dependencies' latest stable version.
- installing the peer dependencies' version which the core dependy you are installing uses.
but i think it performs the latter operation. feel free to let me know if i'm wrong ^-^
this error occurs when you install package with
npm install instead of
yarn install or vice-versa.
i had this problem for ages and i eventually found my solution by sheer chance.
turns out, you can't have spaces or wacky characters in any folder names.
won't work because
in general, it's probably not great practice to be using spaces in folder/file names anyway but i hope this saves someone at least 4 hours of trial and error.
also, any non-alphanumeric characters should be avoided.
npm install -g create-react-app create-react-app my-app cd my-app/ npm start
you install the create-react-app package globally.
after that you run it and create a project called
enter your project folder and then run
npm start. if that doesn't work try running
npm install and then
npm start. if that doesn't work as well, try updating your node version and/or npm.
in package.json, i changed
"start": "react-scripts start"
"start": "node_env=production node_modules/react-scripts/bin/react-scripts.js start"
i hope this solves the problem for some people. although the other solutions above seem not to work for me.
you should not install react-scripts globally, for me this fixed the problem:
npm install --save react react-dom react-scripts
if this still dont work :
- update to latest npm version :
npm install -g npm@latest
- reinstall all dependencies :
i had similar issue. in my case it helped to have yarn installed and first execute the command
and then execute the command
that could work for you too if the project that you cloned have the yarn.lock file. hope it helps!
tried all of the above and nothing worked so i used
npm i react-scripts and it worked
- sh: react-scripts: command not found after running npm start
- How to start react app on specific route in development mode, not from home route, after running command npm start
- after i installed npm on my visual studio terminal to create react js app, when i node start the server its display error: module not found
- Webpack: npm start "Module not found: Error: Can't resolve ..." after moving location for webpack / react files
- npm start command not working, when I try to run my React application
- Babel-loaders module not found in npm start with react js
- I am not getting home component in react website after npm run build command I am only getting Navbar and Footer
- React app freezes after running npm start . The issue is observed while compilation
- React set up error while running npm start :Configuration file found but no entry configured. Use --help to display the CLI options
- Nothing is Displaying on my browser after running npm start in react app
- React app changes not updaiting after running npm run build
- Create a react app and use a npm start command but it is not working
- After running npm start in react application I have this error: internal/modules/cjs/loader.js:834
- React server is not running through npm start
- Npm React Scripts not working after MongoDB installation
- React project not autoloading after npm start
- React project not loading after npm install and npm start
- Problem in the command "npm start" Failed at the email@example.com start script. npm ERR! react-scripts: not found
- Npm start not working after running create-react-app ONLY in Documents directory
- React Native: JAVA_HOME is not set and no 'java' command could be found in your PATH
- Issue with babel-jest dependency when running npm start in a React app
- Error: yarn start - error Command "start" not found
- React npm start not working : 'No version of chokidar available'
- Next JS npm start app load 404 page not found error for physical pages
- React Native Project Running from Xcode but not from command line
- React Native packager.sh: line 11: node: command not found
- React Cannot Start Project - 'craco' is not recognized as an internal or external command
- snowpack Package "abstracts/variables" not found. Have you installed it? getting this error while running npm start
- React Storybook not running after installation of react-leaflet version 3
- React npm start doesn't work after create-react-app
More Query from same tag
- React-Apollo, don't run query on component load
- Reactjs Antd library and google maps Places
- React controlled select element reverts to first option
- Cant send a var to props in another component
- React @reach/Router issues How to make the switchcase work
- map function not working for API data in useEffect - React Hooks
- How to properly access Redux store in the React component?
- Thunk Fetch is Undefined When Called from React Component
- Use external REST API with ReactJS and NodeJS
- How to handle the the onClick events on CheckBox in react js
- React Router v4 - Cannot read property 'params' of undefined
- React useContext with "setState"
- Select multiple files in react with refs
- Material UI Tab loosing connection to Tabs when wrapped inside another component
- function uses this.state and pass it to another component
- How to start playing video by clicking on it without controls using React?
- Highcharts - How to show more than 30 columns side by side
- ReactJs Package
- How to import custom fonts in Next JS?
- Making React.FC global in Typescript
- Reset useState limit request in useEffect (reset to initial limit on value change)
- Eslint - Restrict imports from root and enforce tree-shaking
- Inconsistent focus() with React in Safari/Chrome/Firefox
- React Final Form with react-places-autocomplete
- zDepth in Material-UI not working (React.js)
- req.body undefined from react client to express server
- I cant get my searching program to work on react
- What types to add for methods using react and typescript?
- Creating own node modules to export and import via babel transpiler
- How to get the type of react-bootstrap props