sh: react-scripts: command not found after running npm start
Solution 1:
Check if node_modules
directory exists. After a fresh clone, there will very likely be no node_modules
(since these are .gitignore
'd).
Solution
run npm install
(or yarn
) to ensure all deps are downloaded.
Alternative Solution
If node_modules
exists, remove it with rm -rf node_modules
and then run npm install
(or yarn
).
Solution 2:
Tried all of the above and nothing worked so I used npm i react-scripts
and it worked
Solution 3:
I had similar issue. In my case it helped to have Yarn installed and first execute the command
yarn
and then execute the command
yarn start
That could work for you too if the project that you cloned have the yarn.lock file. Hope it helps!