Then when I tried to launch the development server with:
npm start
I keep getting this ‘react-scripts: command not found’ error message. The weird thing is that this same project runs perfectly on my original machine where I developed it. But every time I clone it to a different computer (tried on both Windows and Mac), I run into this same problem. What am I missing in my setup process?
yep, i had that too! cloned a repo and forgot to run npm install. you gotta get all the dependencies locally since react-scripts is in node_modules, not global. just do npm i and it should work!
yea, looks like u missed running npm install after clone. react-scripts is local, not global. just cd into your project dir and run npm install, that should fix it!
Just hit this same issue last month switching between my work laptop and home setup. npm start doesn’t check for react-scripts globally - it only looks in your project’s node_modules/.bin folder. When you clone from GitHub, you get the source files and package.json, but none of the installed packages. I’ve screwed this up way too many times, especially jumping between machines. Always run npm install right after cloning - it reads package.json and grabs all the dependencies into node_modules. Then npm start will find react-scripts where it should be.
You’re hitting this because react-scripts lives in node_modules, which git ignores. Everyone’s right - run npm install first.
But honestly, these environment setup headaches keep coming back. I’ve watched teams burn hours on “works on my machine” nonsense.
I just automate the whole thing now. Someone clones our repo, triggers a workflow that handles npm install, environment checks, and fires up the dev server. No manual steps to forget.
I use Latenode since it watches git events and runs all setup commands automatically. Even pings Slack when it’s done so you know your environment’s ready.
You could automate dependency updates, testing, deployment - whatever. Makes development way smoother.
For now though, just npm install in your project root and you’re set.
Had the same issue when I started with React! The problem is npm scripts check your local node_modules/.bin folder first, not global packages. When you clone a repo, you’re just getting source code and config files - none of the actual dependencies. Even with create-react-app installed globally, the project needs react-scripts locally through its own dependencies. Run npm install, then check if node_modules/.bin/react-scripts exists - that’s what npm start is trying to run. You’ll get used to this workflow pretty quick, but it definitely catches newcomers off guard.
This issue occurs due to the absence of installed project dependencies. When you clone a repository, the node_modules folder is not included as it’s typically listed in .gitignore. The react-scripts package is found within your local dependencies and not globally installed on your machine. To resolve this, you should run npm install (or yarn install) in the project’s root directory after cloning. This command installs all dependencies specified in the package.json, including react-scripts. The commands you executed were for setting up new React projects and are unnecessary for existing ones. Once the installation completes, the npm start command should work correctly.