Hi Netlify community!
I need your help with something…
I’m currently facing a blockage because my build is failing. The error message indicates that I don’t have react-scripts
installed; however, I have confirmed its presence by running npm list react-scripts
, which shows react-scripts@5.0.1
.
Here’s a snippet from my package.json
:
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"devDependencies": {
"@types/styled-components": "^5.1.34",
"react-scripts": "^5.0.1",
"rimraf": "^6.0.1",
"web-vitals": "^4.2.4"
}
I’ve also attempted to reinstall react-scripts
, clear the cache, and reinstall all dependencies, but I continue to encounter the same errors.
Also, npm run build
is working fine locally.
Below is the log for the failing build:
[...]
3:45:12 PM: > react-scripts build
3:45:12 PM: sh: 1: react-scripts: not found
3:45:12 PM:
3:45:12 PM: "build.command" failed
3:45:12 PM: ────────────────────────────────────────────────────────────────
3:45:12 PM:
3:45:12 PM: Error message
3:45:12 PM: Command failed with exit code 127: npm run build (https://ntl.fyi/exit-code-127)
3:45:12 PM:
3:45:12 PM: Error location
3:45:12 PM: In Build command from Netlify app:
3:45:12 PM: npm run build
3:45:12 PM:
3:45:12 PM: Resolved config
3:45:12 PM: build:
3:45:12 PM: command: npm run build
3:45:12 PM: commandOrigin: ui
3:45:12 PM: publish: /opt/build/repo/build
3:45:12 PM: publishOrigin: ui
3:45:13 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
3:45:13 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
3:45:13 PM: Failing build: Failed to build site
3:45:13 PM: Finished processing build request in 7m59.545s
The repo: https://github.com/julianoiret/mylittlejournal
I would greatly appreciate any assistance you can provide to help resolve this issue. Thank you!
Julia