‘react-scripts’ is not recognized as an internal or external command

Total
0
Shares

React throws error ‘react-scripts’ is not recognized as an internal or external command, when either react-scripts is not installed or there is folder permission errors.

Follow these steps to solve this issue –

  1. Check if node_modules folder has write permission.
  2. If react-scripts is not installed then install it within project scope –

    npm install react-scripts --save

  3. If above step doesn’t work then try removing node_modules folder and reinstall packages using this command –

    rm -rf node_modules && npm install

  4. You may also try auditing the packages for errors. It solves most of the problems –

    npm audit fix

  5. Sometimes packages got deprecated and updating them solves the problem –

    npm update

  6. Clearing the cache could help you too. Try this –

    npm cache clean --force && npm rebuild && npm install

The above steps will solve the React error of ‘react-scripts’ not recognized as an internal or external command.

    Tweet this to help others