Build command failed exit 2

Hello, i am experiencing build issues, I am not sure what is going on.
The name of my application is practitioner-v2.netlify.app

Here is the build output

7:24:27 AM: build-image version: 2821c5fd78f4042b4bb03d028b1983667d2e2d9c (focal)
7:24:27 AM: buildbot version: 9651a880ad155a86e0118402a03ac3a5e674b41e
7:24:27 AM: Fetching cached dependencies
7:24:27 AM: Failed to fetch cache, continuing with build
7:24:27 AM: Starting to prepare the repo for build
7:24:27 AM: No cached dependencies found. Cloning fresh repo
7:24:27 AM: git clone --filter=blob:none https://github.com/Care-Plan-365/practitioner-v2
7:24:28 AM: Preparing Git Reference refs/heads/main
7:24:29 AM: Starting to install dependencies
7:24:29 AM: Python version set to 3.8
7:24:30 AM: Attempting Ruby version 2.7.2, read from environment
7:24:30 AM: Using Ruby version 2.7.2
7:24:31 AM: Started restoring cached go cache
7:24:31 AM: Finished restoring cached go cache
7:24:31 AM: go version go1.19.13 linux/amd64
7:24:31 AM: Using PHP version 8.0
7:24:32 AM: v18.19.0 is already installed.
7:24:32 AM: Now using node v18.19.0 (npm v10.2.3)
7:24:33 AM: Enabling Node.js Corepack
7:24:33 AM: Started restoring cached build plugins
7:24:33 AM: Finished restoring cached build plugins
7:24:33 AM: Started restoring cached corepack dependencies
7:24:33 AM: Finished restoring cached corepack dependencies
7:24:33 AM: No npm workspaces detected
7:24:33 AM: Started restoring cached node modules
7:24:33 AM: Finished restoring cached node modules
7:24:33 AM: Installing npm packages using npm version 10.2.3
7:24:43 AM: npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
7:24:44 AM: npm WARN deprecated rollup-plugin-terser@7.0.2: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser
7:24:44 AM: npm WARN deprecated har-validator@5.1.5: this library is no longer supported
7:24:44 AM: npm WARN deprecated @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs
7:24:44 AM: npm WARN deprecated w3c-hr-time@1.0.2: Use your platform"s native performance.now() and performance.timeOrigin.
npm WARN deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead
7:24:45 AM: npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
7:24:45 AM: npm WARN deprecated workbox-cacheable-response@6.6.0: workbox-background-sync@6.6.0
7:24:46 AM: npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
7:24:47 AM: npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
7:26:33 AM: added 1920 packages, and audited 1921 packages in 2m
7:26:33 AM: 262 packages are looking for funding
7:26:33 AM:   run `npm fund` for details
7:26:33 AM: 18 vulnerabilities (11 moderate, 6 high, 1 critical)
7:26:33 AM: To address issues that do not require attention, run:
7:26:33 AM:   npm audit fix
7:26:33 AM: To address all issues (including breaking changes), run:
7:26:33 AM:   npm audit fix --force
7:26:33 AM: Run `npm audit` for details.
7:26:33 AM: npm packages installed
7:26:34 AM: Successfully installed dependencies
7:26:34 AM: Starting build script
7:26:34 AM: Detected 1 framework(s)
7:26:34 AM: "create-react-app" at version "5.0.1"
7:26:34 AM: Section completed: initializing
7:26:36 AM: ​
7:26:36 AM: Netlify Build                                                 
7:26:36 AM: ────────────────────────────────────────────────────────────────
7:26:36 AM: ​
7:26:36 AM: ❯ Version
7:26:36 AM:   @netlify/build 29.32.0
7:26:36 AM: ​
7:26:36 AM: ❯ Flags
7:26:36 AM:   baseRelDir: true
7:26:36 AM:   buildId: 65a22c988e36340008677b0c
7:26:36 AM:   deployId: 65a22c988e36340008677b0e
7:26:36 AM: ​
7:26:36 AM: ❯ Current directory
7:26:36 AM:   /opt/build/repo
7:26:36 AM: ​
7:26:36 AM: ❯ Config file
7:26:36 AM:   No config file was defined: using default values.
7:26:36 AM: ​
7:26:36 AM: ❯ Context
7:26:36 AM:   production
7:26:36 AM: ​
7:26:36 AM: Build command from Netlify app                                
7:26:36 AM: ────────────────────────────────────────────────────────────────
7:26:36 AM: ​
7:26:36 AM: $ npm run build
7:26:36 AM: > practitional-v2@0.1.0 build
7:26:36 AM: > react-scripts build
7:26:38 AM: Creating an optimized production build...
7:26:38 AM: Browserslist: caniuse-lite is outdated. Please run:
7:26:38 AM:   npx update-browserslist-db@latest
7:26:38 AM:   Why you should do it regularly: https://github.com/browserslist/update-db#readme
7:27:27 AM: Browserslist: caniuse-lite is outdated. Please run:
7:27:27 AM:   npx update-browserslist-db@latest
7:27:27 AM:   Why you should do it regularly: https://github.com/browserslist/update-db#readme
7:27:29 AM: 
7:27:29 AM: Treating warnings as errors because process.env.CI = true.
7:27:29 AM: Most CI servers set it automatically.
7:27:29 AM: 
7:27:29 AM: Failed to compile.
7:27:29 AM: 
7:27:29 AM: [eslint]
7:27:29 AM: src/components/CreateCarePlan/Assessment/Assessment.js
7:27:29 AM:   Line 1:17:  "useEffect" is defined but never used        no-unused-vars
7:27:29 AM:   Line 22:9:  "active" is assigned a value but never used  no-unused-vars
7:27:29 AM: src/components/CreateCarePlan/BillingSummary/BillingSummary.js
7:27:29 AM:   Line 31:6:    React Hook useEffect has a missing dependency: "dispatch". Either include it or remove the dependency array                                                                                                                                                                                                                                                        react-hooks/exhaustive-deps
7:27:29 AM:   Line 189:15:  The href attribute requires a valid value to be accessible. Provide a valid, navigable address as the href value. If you cannot provide a valid href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/anchor-is-valid.md  jsx-a11y/anchor-is-valid
7:27:29 AM: src/components/CreateCarePlan/CreateCareBilling/CreateCareBilling.js
7:27:29 AM:   Line 20:6:  React Hook useEffect has a missing dependency: "dispatch". Either include it or remove the dependency array  react-hooks/exhaustive-deps
7:27:29 AM: src/components/CreateCarePlan/CreateCareBilling/MedicareBilling/MedicareBilling.js
7:27:29 AM:   Line 35:6:  React Hook useEffect has a missing dependency: "dispatch". Either include it or remove the dependency array  react-hooks/exhaustive-deps
7:27:29 AM: src/components/CreateCarePlan/CreateCareBilling/amount/BillingAmount.js
7:27:29 AM:   Line 18:6:  React Hook useEffect has a missing dependency: "dispatch". Either include it or remove the dependency array  react-hooks/exhaustive-deps
7:27:29 AM: src/components/CreateCarePlan/CreateCareBilling/billingFilled/BillingFilled.js
7:27:29 AM:   Line 45:6:  React Hook useEffect has a missing dependency: "dispatch". Either include it or remove the dependency array  react-hooks/exhaustive-deps
7:27:29 AM: src/components/CreateCarePlan/CreateCareBilling/medicareClaims/MedicareClaims.js
7:27:29 AM:   Line 38:6:  React Hook useEffect has a missing dependency: "dispatch". Either include it or remove the dependency array  react-hooks/exhaustive-deps
7:27:29 AM: src/components/CreateCarePlan/CreateCareSchedule/CreateCareSchedule.js
7:27:29 AM:   Line 16:23:   "setAppointment" is assigned a value but never used                                                                                                                                                                                                                                                                                                                no-unused-vars
7:27:29 AM:   Line 28:6:    React Hook useEffect has a missing dependency: "dispatch". Either include it or remove the dependency array                                                                                                                                                                                                                                                        react-hooks/exhaustive-deps
7:27:29 AM:   Line 119:17:  The href attribute requires a valid value to be accessible. Provide a valid, navigable address as the href value. If you cannot provide a valid href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/anchor-is-valid.md  jsx-a11y/anchor-is-valid
7:27:29 AM: src/components/CreateCarePlan/CreateCareSchedule/appointment/CreateAppointment.js
7:27:29 AM:   Line 25:9:  The href attribute requires a valid value to be accessible. Provide a valid, navigable address as the href value. If you cannot provide a valid href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/anchor-is-valid.md  jsx-a11y/anchor-is-valid
7:27:29 AM: src/components/CreateCarePlan/CreateCareSchedule/homework/AddHomework.js
7:27:29 AM:   Line 1:17:  "useState" is defined but never used  no-unused-vars
7:27:29 AM: src/components/CreateCarePlan/CreateCareSchedule/request/ScheduleRequest.js
7:27:29 AM:   Line 1:17:  "useState" is defined but never used  no-unused-vars
7:27:29 AM: src/components/CreateCarePlan/CreatePlan/CreatePlan.js
7:27:29 AM:   Line 1:17:  "useEffect" is defined but never used  no-unused-vars
7:27:29 AM: src/components/DashboardProfile/DashboardProfile.js
7:27:29 AM:   Line 14:9:  "navigate" is assigned a value but never used  no-unused-vars
7:27:29 AM: src/components/DashboardProfile/InvitePatient/InvitePatient.js
7:27:29 AM:   Line 12:10:  "ThreeDots" is defined but never used  no-unused-vars
7:27:29 AM: src/components/DashboardUsersTable/CustomTable.js
7:27:29 AM:   Line 16:10:  "patients" is assigned a value but never used      no-unused-vars
7:27:29 AM:   Line 17:10:  "totalDocs" is assigned a value but never used     no-unused-vars
7:27:29 AM:   Line 30:17:  "error" is assigned a value but never used         no-unused-vars
7:27:29 AM:   Line 30:24:  "isLoading" is assigned a value but never used     no-unused-vars
7:27:29 AM:   Line 30:35:  "isValidating" is assigned a value but never used  no-unused-vars
7:27:29 AM: src/components/Navbar.js
7:27:29 AM:   Line 7:8:   "myPatients" is defined but never used  no-unused-vars
7:27:29 AM:   Line 9:8:   "history" is defined but never used     no-unused-vars
7:27:29 AM:   Line 10:8:  "account" is defined but never used     no-unused-vars
7:27:29 AM: src/pages/DashboardUserDetails/DashboardUserDetails.js
7:27:29 AM:   Line 1:28:  "useState" is defined but never used                                                                                           no-unused-vars
7:27:29 AM:   Line 11:8:  "ReferalNoteAndAppointment" is defined but never used                                                                          no-unused-vars
7:27:29 AM:   Line 26:5:  "assessmentOverview" is assigned a value but never used                                                                        no-unused-vars
7:27:29 AM:   Line 36:6:  React Hook useEffect has missing dependencies: "dispatch" and "params.id". Either include them or remove the dependency array  react-hooks/exhaustive-deps
7:27:29 AM:   Line 42:9:  "step" is assigned a value but never used                                                                                      no-unused-vars
7:27:29 AM: src/pages/DashboardUserDetails/DetailsCareTeam/DetailsCareTeam.js
7:27:29 AM:   Line 3:8:  "teamMember1" is defined but never used  no-unused-vars
7:27:29 AM:   Line 4:8:  "teamMember2" is defined but never used  no-unused-vars
7:27:29 AM: src/pages/DashboardUserDetails/ReferalNoteAppointment/ReferalNoteAndAppointment.js
7:27:29 AM:   Line 2:8:  "addIcon" is defined but never used      no-unused-vars
7:27:29 AM:   Line 3:8:  "teamMember3" is defined but never used  no-unused-vars
7:27:29 AM: ​
7:27:29 AM: "build.command" failed                                        
7:27:29 AM: ────────────────────────────────────────────────────────────────
7:27:29 AM: ​
7:27:29 AM:   Error message
7:27:29 AM:   Command failed with exit code 1: npm run build (https://ntl.fyi/exit-code-1)
7:27:29 AM: ​
7:27:29 AM:   Error location
7:27:29 AM:   In Build command from Netlify app:
7:27:29 AM:   npm run build
7:27:29 AM: ​
7:27:29 AM:   Resolved config
7:27:29 AM:   build:
7:27:29 AM:     command: npm run build
7:27:29 AM:     commandOrigin: ui
7:27:29 AM:     environment:
7:27:29 AM:       - REACT_APP_API_URL
7:27:29 AM:     publish: /opt/build/repo/build
7:27:29 AM:     publishOrigin: ui
7:27:30 AM: Failed during stage "building site": Build script returned non-zero exit code: 2
7:27:30 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
7:27:30 AM: Failing build: Failed to build site
7:27:30 AM: Finished processing build request in 3m3.154s

what can I do?

@Okpanachi_Adaji As it says in the build log:

7:27:29 AM: Treating warnings as errors because process.env.CI = true.
7:27:29 AM: Most CI servers set it automatically.

By default CI is true, and warnings are treated as errors.

Then later your build throws a bunch of warnings…

7:27:29 AM: [eslint]
7:27:29 AM: src/components/CreateCarePlan/Assessment/Assessment.js
7:27:29 AM:   Line 1:17:  "useEffect" is defined but never used        no-unused-vars
7:27:29 AM:   Line 22:9:  "active" is assigned a value but never used  no-unused-vars
...

You can fix the warnings or set CI to false.

The easiest way to do that would be to change the Build command in your Build settings from npm run build to CI= npm run build