Error sh: react-scripts: command not found in Reactjs

Dung Do Tien May 14 2022 457

Hello devs, I have a project with Reactjs. I created the project by using the command :

 npx create-react-app bookshop
cd bookshop
npm start

The project started and run well for me. I pushed code into Github and today I clone the project into my laptop. After running npm install command I ran npm start command but I got an error sh: react-scripts: command not found.

 sh: react-scripts: command not found
error file sh
error code ELIFECYCLE
error errno ENOENT
error syscall spawn
error start: `react-scripts start`
error spawn ENOENT

How can I fix it?

Thanks in advance.

Have 2 answer(s) found.
  • s

    shruti sarva May 14 2022

    Maybe you need install react-scripts again, run command below:


     npm i react-scripts


     yarn add react-scripts 
  • P

    P May 14 2022

    I had the same error, you can try as below to solve your issue:

    Step 1: remove node_modules folder by using rm -rf node_modules command.

    Step 2: Remove the package-lock.json file.

    Step 3: Run npm install and npm start again.

    It really worked for me.

Leave An Answer
* NOTE: You need Login before leave an answer

* Type maximum 2000 characters.

* All comments have to wait approved before display.

* Please polite comment and respect questions and answers of others.

Popular Tips

X Close