How ‘react-scripts’ is not recognized as an internal or external command Error Occurs?
This is a common error you might face while running a Reactjs application. It looks as like below:
react-scripts' is not recognized as an internal or external command, operable program or batch file.
So here I am writing all the possible solutions that I have tried to resolve this error.
ow To Solve ‘react-scripts’ is not recognized as an internal or external command Error?
To Solve ‘react-scripts’ is not recognized as an internal or external command Error
First of all, It is an error about react-scripts file missing in your node_modules/ directory at the time of installation. Check your react-script dependency is available or not in package.json . If package.json
has react-scripts then you just need to npm install and then Your error will be solved. Just run this command: npm install If package.json Doesn’t have react-scripts then Just install react-scripts with this command: npm install react-scripts –save Now, your read-script error must be solved. .
Solution 1: Install react-scripts manually
Usually, This error occurs when react-scripts files doesn’t have in your node_modules folder so the simple and easiest solution is just to install react-scripts manually using this command.
npm install react-scripts --save
Now, your error must be solved.
Solution 2: Check Your package.json
First of all, just check If react-scripts is present in package.json available or not.
If package.json has react-scripts then you just need to npm install and then Your error will be solved. Just run this command.
npm install
If package.json** Doesn’t have react-scripts then Just install react-scripts** with this command.
npm install react-scripts --save
Now, your read-script error must be solved.
Solution 3: Diffrent method
Just run this command.
rm -rf node_modules && npm install
OR Install react-script directly
npm install react-scripts --save-dev
Now, your error must be solved.