Solve – react-scripts: command not found error – React.js

Last Updated On Sunday 7th Aug 2022

react-scripts: command not found

Run the npm install react-scripts command to fix the react-scripts: command not found error.
If you need to delete your node_modules folder and your package_lock.json files, reinstall your dependencies, and restart your development server.

Run the following command in your terminal from your root directory.

with NPM

	npm install

with yarn


This command will install all dependencies found in your package.json files. If the installation command fails to execute, you can re-run the command using the --force flag

	npm install --force

After installing dependencies, you can re run the npm start command.

If you are still having problems, try to specifically install the react-scripts package.

with NPM

	npm install react-scripts

with yarn

	yarn add react-scripts

If the installation command fails to execute, you can re-run the command using the --force flag.

	npm install react-scripts --force

If the error is not resolved, try to delete your node_modules and package-lock.json files, re-run npm install and restart your dev server.

delete node_modules and package-lock.json

	rm -rf node_modules
rm -f package-lock.json
rm -f yarn.lock

clean npm cache and install

	npm cache clean --force

npm install

sh: react-scripts: command not found

Make sure the path to your project doesn’t contain any special characters.

The react-scripts should not be installed globally or in your project’s devDependencies. It should be located in your package.json file

Or install the latest version of the package.

with NPM

	npm install react-scripts@latest react@latest react-dom@latest

with yarn

	yarn add react-scripts@latest react@latest react-dom@latest
react-scripts command not found
react scripts not found
sh react scripts command not found