Solve the 'sh: react-scripts: command not found' error

Today I got this error trying to build a React app:

sh: react-scripts: command not found

How did I solve it?

  1. Clean the cache: npm cache clean -f
  2. Remove package-lock.json
  3. Remove the node-modules folder
  4. Run npm install

Hi, I'm Erik, an engineer from Barcelona. If you like the post or have any comments, say hi.