Deploy failed (Building)

Hey, I’m having an issue trying to deploy my React project, I’m gonna leave the log of the installation and a print of my build settings (even tho it just doesn’t build). I tried to look for some resolutions for this problem but none of them were easy to understand and I’m kinda having a bad time trying to figure out what’s wrong with it. I’m gonna leave the repository here if you guys want to try and test it out or something like that (the repository is on the start of the Deployment Error.

Deployment Error!

12:33:59 AM: build-image version: 50f2c07b4ff67fac131b5b345ef7efb7e0ab9dac (focal)
12:33:59 AM: buildbot version: 3c77419a32191e587913c896861b4b2804c7fa10
12:33:59 AM: Building without cache
12:33:59 AM: Starting to prepare the repo for build
12:33:59 AM: No cached dependencies found. Cloning fresh repo
12:33:59 AM: git clone --filter=blob:none GitHub - bagacopt/PORTFOLIO-REACT
12:34:00 AM: Preparing Git Reference refs/heads/master
12:34:06 AM: Starting to install dependencies
12:34:06 AM: Python version set to 3.8
12:34:06 AM: Attempting Ruby version 2.7.2, read from environment
12:34:07 AM: Using Ruby version 2.7.2
12:34:07 AM: Started restoring cached go cache
12:34:07 AM: Finished restoring cached go cache
12:34:07 AM: go version go1.19.13 linux/amd64
12:34:07 AM: Using PHP version 8.0
12:34:09 AM: v18.18.2 is already installed.
12:34:09 AM: Now using node v18.18.2 (npm v9.8.1)
12:34:09 AM: Enabling Node.js Corepack
12:34:09 AM: Started restoring cached build plugins
12:34:09 AM: Finished restoring cached build plugins
12:34:09 AM: Started restoring cached corepack dependencies
12:34:09 AM: Finished restoring cached corepack dependencies
12:34:09 AM: Started restoring cached yarn cache
12:34:09 AM: Finished restoring cached yarn cache
12:34:09 AM: No yarn workspaces detected
12:34:09 AM: Started restoring cached node modules
12:34:10 AM: Finished restoring cached node modules
12:34:10 AM: Installing npm packages using Yarn version 1.22.19
12:34:10 AM: yarn install v1.22.19
12:34:10 AM: warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
12:34:10 AM: [1/4] Resolving packages…
12:34:11 AM: [2/4] Fetching packages…
12:34:22 AM: [3/4] Linking dependencies…
12:34:22 AM: warning " > @ testing-library/user-event@13.5.0" has unmet peer dependency “@ testing-library/dom@>=7.21.4”.
12:34:22 AM: warning “react-scripts > eslint-config-react-app > eslint-plugin-flowtype@8.0.3” has unmet peer dependency “@ babel/plugin-syntax-flow@^7.14.5”.
12:34:22 AM: warning “react-scripts > eslint-config-react-app > eslint-plugin-flowtype@8.0.3” has unmet peer dependency “@ babel/plugin-transform-react-jsx@^7.14.9”.
12:34:22 AM: warning “react-scripts > react-dev-utils > fork-ts-checker-webpack-plugin@6.5.3” has unmet peer dependency “typescript@>= 2.7”.
12:34:22 AM: warning “react-scripts > eslint-config-react-app > @ typescript-eslint/eslint-plugin > tsutils@3.21.0” has unmet peer dependency “typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta”.
12:34:22 AM: warning " > react-type-animation@3.2.0" has unmet peer dependency “prop-types@^15.5.4”.
12:34:22 AM: warning " > react-typed@1.2.0" has incorrect peer dependency “react@^16.3.0”.
12:34:22 AM: warning " > react-typed@1.2.0" has incorrect peer dependency “react-dom@^16.3.0”.
12:34:22 AM: warning " > react-typical@0.1.3" has unmet peer dependency “prop-types@^15.5.4”.
12:34:22 AM: warning " > react-typical@0.1.3" has incorrect peer dependency “react@^15.0.0 || ^16.0.0”.
12:34:22 AM: warning " > react-typical@0.1.3" has incorrect peer dependency “react-dom@^15.0.0 || ^16.0.0”.
12:34:30 AM: [4/4] Building fresh packages…
12:34:30 AM: Done in 20.22s.
12:34:30 AM: npm packages installed using Yarn
12:34:31 AM: Install dependencies script success
12:34:31 AM: Starting build script
12:34:32 AM: Detected 1 framework(s)
12:34:32 AM: “create-react-app” at version “5.0.1”
12:34:32 AM: Section completed: initializing
12:34:33 AM: ​
12:34:33 AM: Netlify Build
12:34:33 AM: ────────────────────────────────────────────────────────────────
12:34:33 AM: ​
12:34:33 AM: ❯ Version
12:34:33 AM: @ netlify/build 29.24.0
12:34:33 AM: ​
12:34:33 AM: ❯ Flags
12:34:33 AM: baseRelDir: true
12:34:33 AM: buildId: 653d9a657e108010cba98837
12:34:33 AM: deployId: 653d9a657e108010cba98839
12:34:33 AM: ​
12:34:33 AM: ❯ Current directory
12:34:33 AM: /opt/build/repo
12:34:33 AM: ​
12:34:33 AM: ❯ Config file
12:34:33 AM: No config file was defined: using default values.
12:34:33 AM: ​
12:34:33 AM: ❯ Context
12:34:33 AM: production
12:34:33 AM: ​
12:34:33 AM: Build command from Netlify app
12:34:33 AM: ────────────────────────────────────────────────────────────────
12:34:33 AM: ​
12:34:33 AM: $ npm run build
12:34:34 AM: > react-website-project@0.1.0 build
12:34:34 AM: > react-scripts build
12:34:34 AM: Creating an optimized production build…
12:34:38 AM: One of your dependencies, babel-preset-react-app, is importing the
12:34:38 AM: “@ babel/plugin-proposal-private-property-in-object” package without
12:34:38 AM: declaring it in its dependencies. This is currently working because
12:34:38 AM: “@ babel/plugin-proposal-private-property-in-object” is already in your
12:34:38 AM: node_modules folder for unrelated reasons, but it may break at any time.
12:34:38 AM: babel-preset-react-app is part of the create-react-app project, which
12:34:38 AM: is not maintianed anymore. It is thus unlikely that this bug will
12:34:38 AM: ever be fixed. Add “@ babel/plugin-proposal-private-property-in-object” to
12:34:38 AM: your devDependencies to work around this error. This will make this message
12:34:38 AM: go away.
12:34:41 AM:
12:34:41 AM: Treating warnings as errors because process.env.CI = true.
12:34:41 AM: Most CI servers set it automatically.
12:34:41 AM:
12:34:41 AM: Failed to compile.
12:34:41 AM:
12:34:41 AM: [eslint]
12:34:41 AM: src/components/js/AboutMeSection.js
12:34:41 AM: Line 14:21: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images jsx-a11y/alt-text
12:34:41 AM: src/components/js/Button.js
12:34:41 AM: Line 9:11: “checkButtonStyle” is assigned a value but never used no-unused-vars
12:34:41 AM: Line 10:11: “checkButtonSize” is assigned a value but never used no-unused-vars
12:34:41 AM: Line 13:28: Unexpected template string expression no-template-curly-in-string
12:34:41 AM: src/components/js/HomeSection.js
12:34:41 AM: Line 10:67: “idElement” is assigned a value but never used no-unused-vars
12:34:41 AM: src/components/js/pages/Home.js
12:34:41 AM: Line 8:8: “Footer” is defined but never used no-unused-vars
12:34:41 AM: src/components/js/pages/Navbar.js
12:34:41 AM: Line 8:10: “button” is assigned a value but never used no-unused-vars
12:34:41 AM: Line 22:19: Expected “===” and instead saw “==” eqeqeq
12:34:41 AM: ​
12:34:41 AM: “build.command” failed
12:34:41 AM: ────────────────────────────────────────────────────────────────
12:34:41 AM: ​
12:34:41 AM: Error message
12:34:41 AM: Command failed with exit code 1: npm run build (Search results for '"non-zero exit code: 1"' - Netlify Support Forums)
12:34:41 AM: ​
12:34:41 AM: Error location
12:34:41 AM: In Build command from Netlify app:
12:34:41 AM: npm run build
12:34:41 AM: ​
12:34:41 AM: Resolved config
12:34:41 AM: build:
12:34:41 AM: command: npm run build
12:34:41 AM: commandOrigin: ui
12:34:41 AM: environment:
12:34:41 AM: - NPM_TOKEN
12:34:41 AM: publish: /opt/build/repo/build
12:34:41 AM: publishOrigin: ui
12:34:41 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
12:34:41 AM: Failing build: Failed to build site
12:34:41 AM: Finished processing build request in 42.202s
12:34:41 AM: Failed during stage “building site”: Build script returned non-zero exit code: 2

@bagacopt It says why it has failed in the build log:

12:34:41 AM: Treating warnings as errors because process.env.CI = true.
12:34:41 AM: Most CI servers set it automatically.

There is an environment variable of CI which by default is st to true.
When it is true it treats any warnings thrown as errors.
Errors cause your build to fail.

An easy way to set CI to false is to change your Build command.

In your case you can change it from npm run build to CI= npm run build

I’m sorry, I managed to solve it myself it was because of a white space :grinning:

glad to hear you found your solution!