Build error first time deployment

I am trying to deploy my reactjs application on netlify for first time and i am getting this build failed:

8:51:53 PM: Build ready to start
8:51:55 PM: build-image version: 3031d4c9e432fd7016f6279fc9ad706f9205d845
8:51:55 PM: build-image tag: v3.3.17
8:51:55 PM: buildbot version: 1f35b3abd6e2bf5230d8edf68072840fdec1513f
8:51:55 PM: Fetching cached dependencies
8:51:55 PM: Failed to fetch cache, continuing with build
8:51:55 PM: Starting to prepare the repo for build
8:51:56 PM: No cached dependencies found. Cloning fresh repo
8:51:56 PM: git clone https://github.com/kovacevicemir/e-commerce-phone-shop
8:51:56 PM: Preparing Git Reference refs/heads/master
8:51:58 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: ‘build’ versus ‘build/’ in the Netlify UI
8:51:58 PM: Starting build script
8:51:58 PM: Installing dependencies
8:51:58 PM: Python version set to 2.7
8:51:59 PM: v12.18.0 is already installed.
8:51:59 PM: Now using node v12.18.0 (npm v6.14.4)
8:51:59 PM: Started restoring cached build plugins
8:51:59 PM: Finished restoring cached build plugins
8:51:59 PM: Attempting ruby version 2.7.1, read from environment
8:52:01 PM: Using ruby version 2.7.1
8:52:01 PM: Using PHP version 5.6
8:52:01 PM: 5.2 is already installed.
8:52:01 PM: Using Swift version 5.2
8:52:01 PM: Started restoring cached node modules
8:52:01 PM: Finished restoring cached node modules
8:52:01 PM: Installing NPM modules using NPM version 6.14.4
8:52:28 PM: > core-js@2.6.11 postinstall /opt/build/repo/node_modules/babel-runtime/node_modules/core-js
8:52:28 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
8:52:28 PM: > core-js@3.6.5 postinstall /opt/build/repo/node_modules/core-js
8:52:28 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
8:52:28 PM: > core-js-pure@3.6.5 postinstall /opt/build/repo/node_modules/core-js-pure
8:52:28 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
8:52:30 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/webpack-dev-server/node_modules/fsevents):
8:52:30 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
8:52:30 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/watchpack-chokidar2/node_modules/fsevents):
8:52:30 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
8:52:30 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/jest-haste-map/node_modules/fsevents):
8:52:30 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
8:52:30 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modules/fsevents):
8:52:30 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
8:52:30 PM: added 1681 packages from 802 contributors and audited 1685 packages in 28.181s
8:52:32 PM: 61 packages are looking for funding
8:52:32 PM: run npm fund for details
8:52:32 PM: found 1 low severity vulnerability
8:52:32 PM: run npm audit fix to fix them, or npm audit for details
8:52:32 PM: NPM modules installed
8:52:32 PM: Started restoring cached go cache
8:52:32 PM: Finished restoring cached go cache
8:52:32 PM: go version go1.14.4 linux/amd64
8:52:32 PM: go version go1.14.4 linux/amd64
8:52:32 PM: Installing missing commands
8:52:32 PM: Verify run directory
8:52:33 PM: ​
8:52:33 PM: ┌─────────────────────────────┐
8:52:33 PM: │ Netlify Build │
8:52:33 PM: └─────────────────────────────┘
8:52:33 PM: ​
8:52:33 PM: ❯ Version
8:52:33 PM: @netlify/build 2.0.10
8:52:33 PM: ​
8:52:33 PM: ❯ Flags
8:52:33 PM: deployId: 5ef481c95ff6368b649892ba
8:52:33 PM: mode: buildbot
8:52:33 PM: ​
8:52:33 PM: ❯ Current directory
8:52:33 PM: /opt/build/repo
8:52:33 PM: ​
8:52:33 PM: ❯ Config file
8:52:33 PM: No config file was defined: using default values.
8:52:33 PM: ​
8:52:33 PM: ❯ Context
8:52:33 PM: production
8:52:33 PM: ​
8:52:33 PM: ┌────────────────────────────────┐
8:52:33 PM: │ 1. Build command from settings │
8:52:33 PM: └────────────────────────────────┘
8:52:33 PM: ​
8:52:33 PM: $ npm run build
8:52:33 PM: > e-commerce-phone-shop@0.1.0 build /opt/build/repo
8:52:33 PM: > react-scripts build
8:52:34 PM: Creating an optimized production build…
8:52:48 PM:
8:52:48 PM: Treating warnings as errors because process.env.CI = true.
8:52:48 PM: Most CI servers set it automatically.
8:52:48 PM:
8:52:48 PM: Failed to compile.
8:52:48 PM:
8:52:48 PM: ./src/context.js
8:52:48 PM: Line 3:10: ‘ThemeConsumer’ is defined but never used no-unused-vars
8:52:48 PM: Line 87:23: Expected ‘!==’ and instead saw ‘!=’ eqeqeq
8:52:48 PM: ./src/components/Cart/CartItem.js
8:52:48 PM: Line 5:43: ‘clearCart’ is assigned a value but never used no-unused-vars
8:52:48 PM: npm ERR! code ELIFECYCLE
8:52:48 PM: npm ERR! errno 1
8:52:48 PM: npm ERR! e-commerce-phone-shop@0.1.0 build: react-scripts build
8:52:48 PM: npm ERR! Exit status 1
8:52:48 PM: npm ERR!
8:52:48 PM: npm ERR! Failed at the e-commerce-phone-shop@0.1.0 build script.
8:52:48 PM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
8:52:48 PM: npm ERR! A complete log of this run can be found in:
8:52:48 PM: npm ERR! /opt/buildhome/.npm/_logs/2020-06-25T10_52_48_735Z-debug.log
8:52:48 PM: ​
8:52:48 PM: ┌─────────────────────────────┐
8:52:48 PM: │ “build.command” failed │
8:52:48 PM: └─────────────────────────────┘
8:52:48 PM: ​
8:52:48 PM: Error message
8:52:48 PM: Command failed with exit code 1: npm run build
8:52:48 PM: ​
8:52:48 PM: Error location
8:52:48 PM: In Build command from settings:
8:52:48 PM: npm run build
8:52:48 PM: ​
8:52:48 PM: Resolved config
8:52:48 PM: build:
8:52:48 PM: command: npm run build
8:52:48 PM: publish: /opt/build/repo/build
8:52:48 PM: Caching artifacts
8:52:48 PM: Started saving node modules
8:52:48 PM: Finished saving node modules
8:52:48 PM: Started saving build plugins
8:52:48 PM: Finished saving build plugins
8:52:48 PM: Started saving pip cache
8:52:55 PM: Finished saving pip cache
8:52:55 PM: Started saving emacs cask dependencies
8:52:55 PM: Finished saving emacs cask dependencies
8:52:55 PM: Started saving maven dependencies
8:52:55 PM: Finished saving maven dependencies
8:52:55 PM: Started saving boot dependencies
8:52:55 PM: Finished saving boot dependencies
8:52:55 PM: Started saving go dependencies
8:52:55 PM: Finished saving go dependencies
8:52:57 PM: Error running command: Build script returned non-zero exit code: 1
8:52:57 PM: Failing build: Failed to build site
8:52:57 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 1
8:52:57 PM: Finished processing build request in 1m1.939244622s

hi there,

welcome to netlify! i am sure we can get this working. You have this message at the beginning of your log:

Treating warnings as errors because process.env.CI = true.

Let’s resolve that first: