xxxxxxxxxx
# delete the node_modules
rm -rf node_modules
# delete the package-lock.json or yarn.lock
rm -f package-lock.json
rm -f yarn.lock
# clean the npm cache
npm cache clean --force
# Install the dependencies
npm install
xxxxxxxxxx
To Solve sh: react-scripts: command not found Error Just try to install react-scripts with this command: npm i react-scripts And then try to run your project with npm start command Your error should be fixed now.
xxxxxxxxxx
# delete the node_modules
rm -rf node_modules
# delete the package-lock.json or yarn.lock
rm -f package-lock.json
rm -f yarn.lock
# clean the npm cache
npm cache clean --force
# Install the dependencies
npm install --force
or
npm install --legacy-peer-deps
xxxxxxxxxx
rm -rf node_modules 'Remove packages installed
npm install 'Install all packages
xxxxxxxxxx
"start": "NODE_ENV=production node_modules/react-scripts/bin/react-scripts.js start"
//Go to package.json and change "start": "react-scripts start" to the line above" and save the file.
//Try npm start again after this passage
xxxxxxxxxx
"start": "NODE_ENV=production node_modules/react-scripts/bin/react-scripts.js start"
xxxxxxxxxx
Please follow these steps:
Remove package-lock.json form the project's directory.
Then, run npm install.
And then, do npm start again.
If the issue persists do, rm -rf node_modules to remove the node_modules folder and start again from step 1.