React Hook useEffect has missing dependencies

This is name of my site = “symphonious-peony-3985fd”. I am facing an issue while deploying my site.
Issue is = Line 38:8: React Hook useEffect has missing dependencies: ‘auto’, ‘autoScroll’, ‘slideInterval’, and ‘slides’. Either include them or remove the dependency array react-hooks/exhaustive-depsstrong text

Here are the images of my code

11:29:44 AM: Waiting for other deploys from your team to complete. Check the queue: Netlify App
11:29:58 AM: Build ready to start
11:30:00 AM: build-image version: d2c6dbeac570350a387d832f64bc980dc964ad65 (focal)
11:30:00 AM: build-image tag: v4.8.0
11:30:00 AM: buildbot version: 17f6c1ab2fe6d61574ce02b038041b816bf6c085
11:30:00 AM: Fetching cached dependencies
11:30:00 AM: Failed to fetch cache, continuing with build
11:30:00 AM: Starting to prepare the repo for build
11:30:00 AM: No cached dependencies found. Cloning fresh repo
11:30:00 AM: git clone GitHub - niteshjangid29/React_iitr-motorsports_Responsive
11:30:01 AM: Preparing Git Reference refs/heads/master
11:30:01 AM: Parsing package.json dependencies
11:30:02 AM: Starting build script
11:30:02 AM: Installing dependencies
11:30:02 AM: Python version set to 2.7
11:30:03 AM: Downloading and installing node v16.15.0…
11:30:03 AM: Downloading https://nodejs.org/dist/v16.15.0/node-v16.15.0-linux-x64.tar.xz
11:30:03 AM: Computing checksum with sha256sum
11:30:04 AM: Checksums matched!
11:30:06 AM: Now using node v16.15.0 (npm v8.5.5)
11:30:06 AM: Started restoring cached build plugins
11:30:06 AM: Finished restoring cached build plugins
11:30:06 AM: Attempting ruby version 2.7.2, read from environment
11:30:08 AM: Using ruby version 2.7.2
11:30:08 AM: Using PHP version 8.0
11:30:08 AM: No npm workspaces detected
11:30:08 AM: Started restoring cached node modules
11:30:08 AM: Finished restoring cached node modules
11:30:09 AM: Installing NPM modules using NPM version 8.5.5
11:30:10 AM: npm WARN old lockfile
11:30:10 AM: npm WARN old lockfile The package-lock.json file was created with an old version of npm,
11:30:10 AM: npm WARN old lockfile so supplemental metadata must be fetched from the registry.
11:30:10 AM: npm WARN old lockfile
11:30:10 AM: npm WARN old lockfile This is a one-time fix-up, please be patient…
11:30:10 AM: npm WARN old lockfile
11:30:30 AM: npm WARN deprecated source-map-resolve@0.6.0: See GitHub - lydell/source-map-resolve: [DEPRECATED] Resolve the source map and/or sources for a generated file.
11:30:39 AM: npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
11:30:44 AM: added 1435 packages, and audited 1436 packages in 35s
11:30:44 AM: 171 packages are looking for funding
11:30:44 AM: run npm fund for details
11:30:44 AM: 11 vulnerabilities (7 moderate, 3 high, 1 critical)
11:30:44 AM: To address issues that do not require attention, run:
11:30:44 AM: npm audit fix
11:30:44 AM: To address all issues (including breaking changes), run:
11:30:44 AM: npm audit fix --force
11:30:44 AM: Run npm audit for details.
11:30:44 AM: NPM modules installed
11:30:44 AM: Started restoring cached go cache
11:30:44 AM: Finished restoring cached go cache
11:30:45 AM: go version go1.16.5 linux/amd64
11:30:45 AM: go version go1.16.5 linux/amd64
11:30:45 AM: Installing missing commands
11:30:45 AM: Verify run directory
11:30:46 AM: ​
11:30:46 AM: ────────────────────────────────────────────────────────────────
11:30:46 AM: Netlify Build
11:30:46 AM: ────────────────────────────────────────────────────────────────
11:30:46 AM: ​
11:30:46 AM: ❯ Version
11:30:46 AM: @netlify/build 27.1.3
11:30:46 AM: ​
11:30:46 AM: ❯ Flags
11:30:46 AM: baseRelDir: true
11:30:46 AM: buildId: 628c7450a9d9f0380d6fd567
11:30:46 AM: deployId: 628c7450a9d9f0380d6fd569
11:30:46 AM: ​
11:30:46 AM: ❯ Current directory
11:30:46 AM: /opt/build/repo
11:30:46 AM: ​
11:30:46 AM: ❯ Config file
11:30:46 AM: No config file was defined: using default values.
11:30:46 AM: ​
11:30:46 AM: ❯ Context
11:30:46 AM: production
11:30:46 AM: ​
11:30:46 AM: ────────────────────────────────────────────────────────────────
11:30:46 AM: 1. Build command from Netlify app
11:30:46 AM: ────────────────────────────────────────────────────────────────
11:30:46 AM: ​
11:30:46 AM: $ npm run build
11:30:46 AM: > motorsports@0.1.0 build
11:30:46 AM: > react-scripts build
11:30:48 AM: Creating an optimized production build…
11:31:02 AM:
11:31:02 AM: Treating warnings as errors because process.env.CI = true.
11:31:02 AM: Most CI servers set it automatically.
11:31:02 AM:
11:31:02 AM: Failed to compile.
11:31:02 AM:
11:31:02 AM: src/components/Slider/Slider.js
11:31:02 AM: Line 38:8: React Hook useEffect has missing dependencies: ‘auto’, ‘autoScroll’, ‘slideInterval’, and ‘slides’. Either include them or remove the dependency array react-hooks/exhaustive-deps
11:31:02 AM: ​
11:31:02 AM: ────────────────────────────────────────────────────────────────
11:31:02 AM: “build.command” failed
11:31:02 AM: ────────────────────────────────────────────────────────────────
11:31:02 AM: ​
11:31:02 AM: Error message
11:31:02 AM: Command failed with exit code 1: npm run build (Search results for '"non-zero exit code: 1"' - Netlify Support Forums)
11:31:02 AM: ​
11:31:02 AM: Error location
11:31:02 AM: In Build command from Netlify app:
11:31:02 AM: npm run build
11:31:02 AM: ​
11:31:02 AM: Resolved config
11:31:02 AM: build:
11:31:02 AM: command: npm run build
11:31:02 AM: commandOrigin: ui
11:31:02 AM: publish: /opt/build/repo/build
11:31:02 AM: publishOrigin: ui
11:31:02 AM: Caching artifacts
11:31:02 AM: Started saving node modules
11:31:02 AM: Finished saving node modules
11:31:02 AM: Started saving build plugins
11:31:02 AM: Finished saving build plugins
11:31:02 AM: Started saving pip cache
11:31:02 AM: Finished saving pip cache
11:31:02 AM: Started saving emacs cask dependencies
11:31:02 AM: Finished saving emacs cask dependencies
11:31:02 AM: Started saving maven dependencies
11:31:02 AM: Finished saving maven dependencies
11:31:02 AM: Started saving boot dependencies
11:31:02 AM: Finished saving boot dependencies
11:31:02 AM: Started saving rust rustup cache
11:31:02 AM: Finished saving rust rustup cache
11:31:02 AM: Started saving go dependencies
11:31:02 AM: Finished saving go dependencies
11:31:04 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
11:31:04 AM: Creating deploy upload records
11:31:04 AM: Failing build: Failed to build site
11:31:04 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)
11:31:04 AM: Finished processing build request in 1m4.352897563s

Hi @niteshjangid29,

Try changing your build command to CI= npm run build.

Hello Sir,
I have tried by changing my build command but while uploading, it runs “npm run build” more than 600 times and still in process. :smiling_face_with_tear:
I have attached the photo of it.

And after that

Deploy failed :sob:

Please share the site name.

@hrishikesh
The site name is https://nitesh-jangid-netlify.netlify.app/

Your repo is private, so I can’t comment much, but looks like the build script in your package.json has the command npm run build. Since you’re using React, I believe, it should be react-scripts build.