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_modules
folder has write permission. - If
react-scripts
is not installed then install it within project scope –npm install react-scripts --save
- If above step doesn’t work then try removing
node_modules
folder 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 –
npm update
- 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.