Deployment failing with "build.command failed"

Hello Netlify Support,

I’m facing a deployment issue with my site.

Site Name: https://elevatematch.netlify.app/
Build Command: npm run build
Publish Directory: build

Issue:
Deployment fails with the error: “build.command failed”

What I’ve Tried:

  • Verified build command and publish directory
  • Ran build locally (mention whether it works or fails)
  • Cleared Netlify build cache and redeployed
  • Checked Node version compatibility

Deploy Log Error:
3:52:47 PM: In build.command from netlify.toml:
3:52:47 PM: CI= npm run build
3:52:47 PM: ​
3:52:47 PM: Resolved config
3:52:47 PM: build:
3:52:47 PM: base: /opt/build/repo
3:52:47 PM: command: CI= npm run build
3:52:47 PM: commandOrigin: config
3:52:47 PM: environment:
3:52:47 PM: - NODE_VERSION
3:52:47 PM: - NPM_FLAGS
3:52:47 PM: processing:
3:52:47 PM: css:
3:52:47 PM: bundle: true
3:52:47 PM: minify: true
3:52:47 PM: html:
3:52:47 PM: pretty_urls: true
3:52:47 PM: js:
3:52:47 PM: bundle: true
3:52:47 PM: minify: true
3:52:47 PM: skip_processing: false
3:52:47 PM: publish: /opt/build/repo/build
3:52:47 PM: publishOrigin: config
3:52:47 PM: headers:
3:52:47 PM: - for: /*
values:
Referrer-Policy: strict-origin-when-cross-origin
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
- for: /static/*
values:
Cache-Control: public, max-age=31536000, immutable
headersOrigin: config
redirects:
- from: /*
status: 200
to: /index.html
redirectsOrigin: config
3:52:47 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
3:52:47 PM: Failing build: Failed to build site
3:52:47 PM: Finished processing build request in 41.673s

Kindly assist me in resolving this issue.

Thank you!

This is the error (not the part you’ve shared):

Seems like a TypeScript error and not something caused by Netlify. Please check your code.