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 –
- Check if
node_modulesfolder has write permission.
react-scriptsis not installed then install it within project scope –
npm install react-scripts --save
- If above step doesn’t work then try removing
node_modulesfolder and reinstall packages using this command –
rm -rf node_modules && npm install
- You may also try auditing the packages for errors. It solves most of the problems –
npm audit fix
- Sometimes packages got deprecated and updating them solves the problem –
- 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.