The app was built with create-react-app. Everything works fine locally. However, I kept getting this error from Netlify I've tried to install react-scripts but it didn't work. Same error causing Netlify deployment failure.
Netlify Log Details -
$ yarn build
yarn run v1.22.17
$ cd client && npm run build
my-app@0.1.0 build
react-scripts build
sh: 1: react-scripts: not found
error Command failed with exit code 127.
───────────────────────────────────────────────────────────────
Error message
Command failed with exit code 127: yarn build
Error location
In Build command from Netlify app:
yarn build
package.json file in my client folder
{
"name": "my-app",
"version": "0.1.0",
"private": true,
"proxy": "http://localhost:8888",
"dependencies": {
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"axios": "^0.24.0",
"dotenv": "^10.0.0",
"firebase": "^9.1.2",
"lodash.memoize": "^4.1.2",
"node-sass": "^6.0.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-redux": "^7.2.5",
"react-router-dom": "^5.3.0",
"react-scripts": "^4.0.3",
"react-stripe-checkout": "^2.6.3",
"redux": "^4.1.1",
"redux-logger": "^3.0.6",
"redux-persist": "^6.0.0",
"redux-saga": "^1.1.3",
"redux-thunk": "^2.4.0",
"reselect": "^4.0.0",
"web-vitals": "^0.2.4",
"workbox-background-sync": "^5.1.3",
"workbox-broadcast-update": "^5.1.3",
"workbox-cacheable-response": "^5.1.3",
"workbox-core": "^5.1.3",
"workbox-expiration": "^5.1.3",
"workbox-google-analytics": "^5.1.3",
"workbox-navigation-preload": "^5.1.3",
"workbox-precaching": "^5.1.3",
"workbox-range-requests": "^5.1.3",
"workbox-routing": "^5.1.3",
"workbox-strategies": "^5.1.3",
"workbox-streams": "^5.1.3"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
Is there anything wrong with my dependencies?