Build failed on React application

Hello,

Trying to deploy my React website, I’m having troubles with the building, which fails everytime.

10:19:38 PM: ​
10:19:38 PM: build.command failed                                        
10:19:38 PM: ────────────────────────────────────────────────────────────────
10:19:38 PM: ​
10:19:38 PM:   Error message
10:19:38 PM:   Command failed with exit code 1: npm run build (https://ntl.fyi/exit-code-1)
10:19:38 PM: ​
10:19:38 PM:   Error location
10:19:38 PM:   In Build command from Netlify app:
10:19:38 PM:   npm run build
10:19:38 PM: ​
10:19:38 PM:   Resolved config
10:19:38 PM:   build:
10:19:38 PM:     command: npm run build
10:19:38 PM:     commandOrigin: ui
10:19:38 PM:     publish: /opt/build/repo/build
10:19:38 PM:     publishOrigin: ui
10:19:39 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
10:19:39 PM: Failing build: Failed to build site
10:19:40 PM: Finished processing build request in 2m4.456s

I do not reproduce this error on local, the build works fine, can’t resolve it…Any thoughts ?

You’ve removed all the useful parts of the log. Please share the link.