Error Command failed with exit code 1

PLEASE help us help you by writing a good post!

  • we need to know your netlify site name. Example: gifted-antelope-58b104.netlify.app
  • DNS issues? Tell us the custom domain, tell us the error message! We can’t help if we don’t know your domain.
  • Build problems? Link or paste the FULL build log & build settings screenshot

The better the post - the faster the answer.

https://app.netlify.com/sites/melodious-bubblegum-303288/deploys/634994fe2226fe0009c7686c

7:57:34 PM: Build ready to start
7:57:48 PM: build-image version: 9289b698a503f132b265bd089ab40ce1d6f9e65e (focal)
7:57:48 PM: build-image tag: v4.12.0
7:57:48 PM: buildbot version: 2510ae842d7cc96532da2c05a74ba836f3e7f056
7:57:48 PM: Fetching cached dependencies
7:57:48 PM: Failed to fetch cache, continuing with build
7:57:48 PM: Starting to prepare the repo for build
7:57:49 PM: No cached dependencies found. Cloning fresh repo
7:57:49 PM: git clone GitHub - yuragms/social-media-app-client-netlify: 1)React router v6 2)redux 3)store persistance 3)Jwt Authenitcation 4)Redux thunk middleware 5)Mongodb 6)express 7)Node.js 8)AWS s3 9)socket.io (social-media-app-clientServer2)
7:57:49 PM: Preparing Git Reference refs/heads/main
7:57:49 PM: Parsing package.json dependencies
7:57:51 PM: Starting build script
7:57:51 PM: Installing dependencies
7:57:51 PM: Python version set to 2.7
7:57:51 PM: Downloading and installing node v16.18.0…
7:57:51 PM: Downloading https://nodejs.org/dist/v16.18.0/node-v16.18.0-linux-x64.tar.xz
7:57:52 PM: Computing checksum with sha256sum
7:57:52 PM: Checksums matched!
7:57:55 PM: Now using node v16.18.0 (npm v8.19.2)
7:57:55 PM: Started restoring cached build plugins
7:57:55 PM: Finished restoring cached build plugins
7:57:55 PM: Attempting ruby version 2.7.2, read from environment
7:57:56 PM: Using ruby version 2.7.2
7:57:56 PM: Using PHP version 8.0
7:57:56 PM: Started restoring cached yarn cache
7:57:56 PM: Finished restoring cached yarn cache
7:57:56 PM: No yarn workspaces detected
7:57:56 PM: Started restoring cached node modules
7:57:56 PM: Finished restoring cached node modules
7:57:56 PM: Installing NPM modules using Yarn version 1.22.19
7:57:57 PM: npm WARN config tmp This setting is no longer used. npm stores temporary files in a special
7:57:57 PM: npm WARN config location in the cache, and they are managed by
7:57:57 PM: npm WARN config cacache.
7:57:57 PM: yarn install v1.22.19
7:57:57 PM: 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.
7:57:57 PM: [1/4] Resolving packages…
7:57:57 PM: [2/4] Fetching packages…
7:58:11 PM: [3/4] Linking dependencies…
7:58:11 PM: warning " > @iconscout/react-unicons@1.1.6" has incorrect peer dependency “react@>=15.0.0 <17.0.0”.
7:58:11 PM: warning “@mantine/core > @mantine/styles > @emotion/react > @emotion/babel-plugin@11.9.2” has unmet peer dependency “@babel/core@^7.0.0”.
7:58:11 PM: warning “@mantine/core > @mantine/styles > @emotion/react > @emotion/babel-plugin > @babel/plugin-syntax-jsx@7.16.7” has unmet peer dependency “@babel/core@^7.0.0-0”.
7:58:11 PM: warning " > @testing-library/user-event@13.5.0" has unmet peer dependency “@testing-library/dom@>=7.21.4”.
7:58:11 PM: warning " > react-input-emoji@4.2.0" has unmet peer dependency “prop-types@>=15.7.2”.
7:58:11 PM: warning “react-scripts > tailwindcss@3.0.23” has unmet peer dependency “autoprefixer@^10.0.2”.
7:58:11 PM: warning “react-scripts > eslint-config-react-app > eslint-plugin-flowtype@8.0.3” has unmet peer dependency “@babel/plugin-syntax-flow@^7.14.5”.
7:58:11 PM: 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”.
7:58:11 PM: warning “react-scripts > react-dev-utils > fork-ts-checker-webpack-plugin@6.5.0” has unmet peer dependency “typescript@>= 2.7”.
7:58:11 PM: 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”.
7:58:18 PM: [4/4] Building fresh packages…
7:58:18 PM: Done in 21.49s.
7:58:18 PM: NPM modules installed using Yarn
7:58:18 PM: Started restoring cached go cache
7:58:18 PM: Finished restoring cached go cache
7:58:18 PM: Installing Go version 1.17 (requested 1.17)
7:58:23 PM: unset GOOS;
7:58:23 PM: unset GOARCH;
7:58:23 PM: export GOROOT=‘/opt/buildhome/.gimme/versions/go1.17.linux.amd64’;
7:58:23 PM: export PATH=“/opt/buildhome/.gimme/versions/go1.17.linux.amd64/bin:${PATH}”;
7:58:23 PM: go version >&2;
7:58:23 PM: export GIMME_ENV=“/opt/buildhome/.gimme/env/go1.17.linux.amd64.env”
7:58:23 PM: go version go1.17 linux/amd64
7:58:23 PM: Installing missing commands
7:58:23 PM: Verify run directory
7:58:24 PM: ​
7:58:24 PM: ────────────────────────────────────────────────────────────────
7:58:24 PM: Netlify Build
7:58:24 PM: ────────────────────────────────────────────────────────────────
7:58:24 PM: ​
7:58:24 PM: ❯ Version
7:58:24 PM: @netlify/build 27.20.6
7:58:24 PM: ​
7:58:24 PM: ❯ Flags
7:58:24 PM: baseRelDir: true
7:58:24 PM: buildId: 634994fe2226fe0009c7686a
7:58:24 PM: deployId: 634994fe2226fe0009c7686c
7:58:24 PM: ​
7:58:24 PM: ❯ Current directory
7:58:24 PM: /opt/build/repo
7:58:24 PM: ​
7:58:24 PM: ❯ Config file
7:58:24 PM: No config file was defined: using default values.
7:58:24 PM: ​
7:58:24 PM: ❯ Context
7:58:24 PM: production
7:58:24 PM: ​
7:58:24 PM: ────────────────────────────────────────────────────────────────
7:58:24 PM: 1. Build command from Netlify app
7:58:24 PM: ────────────────────────────────────────────────────────────────
7:58:24 PM: ​
7:58:24 PM: $ yarn build
7:58:24 PM: yarn run v1.22.19
7:58:24 PM: $ react-scripts build
7:58:25 PM: Creating an optimized production build…
7:58:49 PM:
7:58:49 PM: Treating warnings as errors because process.env.CI = true.
7:58:49 PM: Most CI servers set it automatically.
7:58:49 PM:
7:58:49 PM: Failed to compile.
7:58:49 PM:
7:58:49 PM: Warning
7:58:49 PM: (26:3) autoprefixer: start value has mixed support, consider using flex-start instead
7:58:49 PM: src/Components/ChatBox/ChatBox.jsx
7:58:49 PM: Line 82:6: React Hook useEffect has missing dependencies: ‘chat._id’ and ‘messages’. Either include them or remove the dependency array. You can also do a functional update ‘setMessages(m => …)’ if you only need ‘messages’ in the ‘setMessages’ call react-hooks/exhaustive-deps
7:58:49 PM: src/Components/Conversation/Conversation.jsx
7:58:49 PM: Line 21:6: React Hook useEffect has missing dependencies: ‘currentUserId’ and ‘data.members’. Either include them or remove the dependency array react-hooks/exhaustive-deps
7:58:49 PM: src/Components/FollowersCard/FollowersCard.jsx
7:58:49 PM: Line 25:33: Array.prototype.map() expects a value to be returned at the end of arrow function array-callback-return
7:58:49 PM: src/Components/InfoCard/InfoCard.jsx
7:58:49 PM: Line 30:6: React Hook useEffect has a missing dependency: ‘profileUserId’. Either include it or remove the dependency array react-hooks/exhaustive-deps
7:58:49 PM: src/Components/Posts/Posts.jsx
7:58:49 PM: Line 19:6: React Hook useEffect has missing dependencies: ‘dispatch’ and ‘user._id’. Either include them or remove the dependency array react-hooks/exhaustive-deps
7:58:49 PM: src/Components/ProfileModal.jsx/ProfileModal.jsx
7:58:49 PM: Line 2:23: ‘useSelector’ is defined but never used no-unused-vars
7:58:49 PM: error Command failed with exit code 1. (Search results for '"non-zero exit code: 1"' - Netlify Support Forums)
7:58:49 PM: info Visit yarn run | Yarn for documentation about this command.
7:58:49 PM: ​
7:58:49 PM: ────────────────────────────────────────────────────────────────
7:58:49 PM: “build.command” failed
7:58:49 PM: ────────────────────────────────────────────────────────────────
7:58:49 PM: ​
7:58:49 PM: Error message
7:58:49 PM: Command failed with exit code 1: yarn build (Search results for '"non-zero exit code: 1"' - Netlify Support Forums)
7:58:49 PM: ​
7:58:49 PM: Error location
7:58:49 PM: In Build command from Netlify app:
7:58:49 PM: yarn build
7:58:49 PM: ​
7:58:49 PM: Resolved config
7:58:49 PM: build:
7:58:49 PM: command: yarn build
7:58:49 PM: commandOrigin: ui
7:58:49 PM: publish: /opt/build/repo/build
7:58:49 PM: publishOrigin: ui
7:58:50 PM: Caching artifacts
7:58:50 PM: Started saving node modules
7:58:50 PM: Finished saving node modules
7:58:50 PM: Started saving build plugins
7:58:50 PM: Finished saving build plugins
7:58:50 PM: Started saving yarn cache
7:58:52 PM: Finished saving yarn cache
7:58:52 PM: Started saving pip cache
7:58:52 PM: Finished saving pip cache
7:58:52 PM: Started saving emacs cask dependencies
7:58:52 PM: Finished saving emacs cask dependencies
7:58:52 PM: Started saving maven dependencies
7:58:52 PM: Finished saving maven dependencies
7:58:52 PM: Started saving boot dependencies
7:58:52 PM: Finished saving boot dependencies
7:58:52 PM: Started saving rust rustup cache
7:58:52 PM: Finished saving rust rustup cache
7:58:52 PM: Started saving go dependencies
7:58:52 PM: Finished saving go dependencies
7:58:53 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
7:58:53 PM: Creating deploy upload records
7:58:53 PM: Failing build: Failed to build site
7:58:53 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2 (Search results for '"non-zero exit code: 2"' - Netlify Support Forums)
7:58:53 PM: Finished processing build request in 1m4.917911848s

I need help))

This part shows that you have some React warnings that are treated as errors.

You can either fix the warnings or go to Site settings → Build & deploy → Environment and add the following environment variable:

Key: CI Value: False

That will treat the warnings as warnings during the build.

You are the best, thank you

пт, 14 окт. 2022 г. в 22:24, Art Anderson via Netlify Support Forums <notifications@netlify.discoursemail.com>: