React project deploy failed non zero exit code 2

I need advice to debug deploy https://app.netlify.com/sites/mystifying-wozniak-e8beae/deploys/6008259e3434cfebdfaac8c4
Thank you for help.

Here is the error message:

Failed during stage ‘building site’: Build script returned non-zero exit code: 2

From log:

$ npm run build
2:45:14 PM: > alphcons@0.1.0 build /opt/build/repo
2:45:14 PM: > CI = react-scripts build
2:45:14 PM: sh: 1: CI: not found
2:45:14 PM: npm ERR! code ELIFECYCLE
2:45:14 PM: npm ERR! syscall spawn
2:45:14 PM: npm ERR! file sh
2:45:14 PM: npm ERR! errno ENOENT
2:45:14 PM: npm ERR! alphcons@0.1.0 build: CI = react-scripts build
2:45:14 PM: npm ERR! spawn ENOENT
2:45:14 PM: npm ERR!
2:45:14 PM: npm ERR! Failed at the alphcons@0.1.0 build script.
2:45:14 PM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2:45:14 PM: npm ERR! A complete log of this run can be found in:
2:45:14 PM: npm ERR! /opt/buildhome/.npm/_logs/2021-01-20T12_45_14_790Z-debug.log
2:45:14 PM: ​
2:45:14 PM: ────────────────────────────────────────────────────────────────
2:45:14 PM: “build.command” failed
2:45:14 PM: ────────────────────────────────────────────────────────────────
2:45:14 PM: ​
2:45:14 PM: Error message
2:45:14 PM: Command failed with exit code 1: npm run build
2:45:14 PM: ​
2:45:14 PM: Error location
2:45:14 PM: In Build command from Netlify app:
2:45:14 PM: npm run build
2:45:14 PM: ​

The build command should be CI= react-scripts build. Notice the lack of space to the left of =.

Thank you for the answer. I eliminated the space before =. This helped! :slight_smile: