Failed build for React app (previously worked)

Hello there! I am seeking help regarding a build issue, I sincerely hope someone can help me please. I created my portfolio website last month and deployed it with ease(including custom domain), however I have since updated a few files and now it continually fails to build. I tried a number of things, one being leaving the base directory, publish directory and build command not set which successfully published my site, however it now completely unaccessible.

Site Name : kharileighmiller.com
GitHub Repo : GitHub - kharileigh/PORTFOLIO: A portfolio website for a multi-passionate individual with an insatiable curiosity for life and learning, Khari-Leigh Miller.

Current Site Settings :
Base directory - Not set
Build command - npm run build
Publish directory - build
Deploy log visibility - Logs are private
Builds - Active

Here is the most current deployment log with the current site settings :

10:03:35 AM: ────────────────────────────────────────────────────────────────
10:03:35 AM: Netlify Build
10:03:35 AM: ────────────────────────────────────────────────────────────────
10:03:35 AM: ​
10:03:35 AM: ❯ Version
10:03:35 AM: @netlify/build 27.11.3
10:03:35 AM: ​
10:03:35 AM: ❯ Flags
10:03:35 AM: baseRelDir: true
10:03:35 AM: buildId: 62fb5d2f546c9f7282aedb96
10:03:35 AM: deployId: 62fb5d2f546c9f7282aedb98
10:03:35 AM: ​
10:03:35 AM: ❯ Current directory
10:03:35 AM: /opt/build/repo
10:03:35 AM: ​
10:03:35 AM: ❯ Config file
10:03:35 AM: No config file was defined: using default values.
10:03:35 AM: ​
10:03:35 AM: ❯ Context
10:03:35 AM: production
10:03:35 AM: ​
10:03:35 AM: ────────────────────────────────────────────────────────────────
10:03:35 AM: 1. Build command from Netlify app
10:03:35 AM: ────────────────────────────────────────────────────────────────
10:03:35 AM: ​
10:03:35 AM: $ npm run build
10:03:35 AM: npm WARN config tmp This setting is no longer used. npm stores temporary files in a special
10:03:35 AM: npm WARN config location in the cache, and they are managed by
10:03:35 AM: npm WARN config cacache.
10:03:35 AM: > portfolio-khari@1.0.0 build
10:03:35 AM: > react-scripts build
10:03:36 AM: Creating an optimized production build…
10:03:42 AM:
10:03:42 AM: Treating warnings as errors because process.env.CI = true.
10:03:42 AM: Most CI servers set it automatically.
10:03:42 AM:
10:03:42 AM: Failed to compile.
10:03:42 AM:
10:03:42 AM: Warning
10:03:42 AM: (39:5) autoprefixer: end value has mixed support, consider using flex-end instead
10:03:42 AM: ​
10:03:42 AM: ────────────────────────────────────────────────────────────────
10:03:42 AM: “build.command” failed
10:03:42 AM: ────────────────────────────────────────────────────────────────
10:03:42 AM: ​
10:03:42 AM: Error message
10:03:42 AM: Command failed with exit code 1: npm run build (Search results for '"non-zero exit code: 1"' - Netlify Support Forums)
10:03:42 AM: ​
10:03:42 AM: Error location
10:03:42 AM: In Build command from Netlify app:
10:03:42 AM: npm run build
10:03:42 AM: ​
10:03:42 AM: Resolved config
10:03:42 AM: build:
10:03:42 AM: command: npm run build
10:03:42 AM: commandOrigin: ui
10:03:42 AM: publish: /opt/build/repo/build
10:03:42 AM: publishOrigin: ui
10:03:42 AM: Caching artifacts
10:03:42 AM: Started saving node modules
10:03:42 AM: Finished saving node modules
10:03:42 AM: Started saving build plugins
10:03:42 AM: Finished saving build plugins
10:03:42 AM: Started saving pip cache
10:03:42 AM: Finished saving pip cache
10:03:42 AM: Started saving emacs cask dependencies
10:03:42 AM: Finished saving emacs cask dependencies
10:03:42 AM: Started saving maven dependencies
10:03:42 AM: Finished saving maven dependencies
10:03:42 AM: Started saving boot dependencies
10:03:42 AM: Finished saving boot dependencies
10:03:42 AM: Started saving rust rustup cache
10:03:42 AM: Finished saving rust rustup cache
10:03:42 AM: Started saving go dependencies
10:03:42 AM: Finished saving go dependencies
10:03:44 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
10:03:44 AM: Creating deploy upload records
10:03:44 AM: Failing build: Failed to build site
10:03:44 AM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2 (Search results for '"non-zero exit code: 2"' - Netlify Support Forums)
10:03:44 AM: Finished processing build request in 45.043050573s

I have tried a number of things as per following previous posts on here but still unsuccessful. I appreciate any help that is offered.

Kind Regards,
Khari

Hi @kharileigh

Quite likely this message is referring to this line the PageNavBar.css in the repository you shared.

Hi! I have now updated this but it was still unsuccessful.

However, great news! I changed the environment variable CI from true to false and that has now worked! Thank you for your time! :slight_smile:

That is great news! Thanks for coming back and sharing, @kharileigh. Happy building :rocket: