I am a noob with Netlfiy. I am trying to deploy a React app, however I keep getting Command failed with exit code 1 when it gets to the building stage. Iβve tried looking it up in the forums and tried everything I could find but had no luck. However it does build locally with no issues.
I donβt know how to mark this as solved, but I found the issue. The Initialization part gave a warning, I fixed what it warned about and it deployed no issues
The better the post - the faster the answer.
12:22:08 PM: build-image version: 20e1f1f500e4cbad9ea8a99bd40807bef3093551 (focal)
12:22:08 PM: buildbot version: 77071362d8e2c4892a900c59914f4f5b20867e29
12:22:08 PM: Building without cache
12:22:08 PM: Starting to prepare the repo for build
12:22:08 PM: No cached dependencies found. Cloning fresh repo
12:22:08 PM: git clone --filter=blob:none https://github.com/cdraper033/my-react-forecast-app
12:22:08 PM: Preparing Git Reference refs/heads/main
12:22:10 PM: Starting to install dependencies
12:22:10 PM: Python version set to 3.8
12:22:10 PM: Attempting Ruby version 2.7.2, read from environment
12:22:11 PM: Using Ruby version 2.7.2
12:22:11 PM: Started restoring cached go cache
12:22:11 PM: Finished restoring cached go cache
12:22:12 PM: Installing Go version 1.19.12 (requested 1.19.x)
12:22:17 PM: go version go1.19.12 linux/amd64
12:22:17 PM: Using PHP version 8.0
12:22:18 PM: v18.17.0 is already installed.
12:22:19 PM: Now using node v18.17.0 (npm v9.6.7)
12:22:19 PM: Enabling Node.js Corepack
12:22:19 PM: Started restoring cached build plugins
12:22:19 PM: Finished restoring cached build plugins
12:22:19 PM: Started restoring cached corepack dependencies
12:22:19 PM: Finished restoring cached corepack dependencies
12:22:19 PM: No npm workspaces detected
12:22:19 PM: Started restoring cached node modules
12:22:19 PM: Finished restoring cached node modules
12:22:19 PM: Installing npm packages using npm version 9.6.7
12:22:22 PM: npm WARN deprecated [email protected]: Use your platform's native performance.now() and performance.timeOrigin.
npm WARN deprecated [email protected]: 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
12:22:23 PM: npm WARN deprecated [email protected]: Please use @jridgewell/sourcemap-codec instead
12:22:23 PM: npm WARN deprecated [email protected]: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser
12:22:23 PM: npm WARN deprecated [email protected]: [email protected]
12:22:25 PM: npm WARN deprecated [email protected]: This SVGO version is no longer supported. Upgrade to v2.x.x.
12:22:29 PM: added 1501 packages, and audited 1502 packages in 10s
12:22:29 PM: 241 packages are looking for funding
12:22:29 PM: run `npm fund` for details
12:22:29 PM: 6 high severity vulnerabilities
12:22:29 PM: To address all issues (including breaking changes), run:
12:22:29 PM: npm audit fix --force
12:22:29 PM: Run `npm audit` for details.
12:22:29 PM: npm packages installed
12:22:30 PM: Install dependencies script success
12:22:30 PM: Starting build script
12:22:31 PM: Detected 1 framework(s)
12:22:31 PM: create-react-app at version 5.0.1
12:22:31 PM: Section completed: initializing
12:22:32 PM: β
12:22:32 PM: Netlify Build
12:22:32 PM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
12:22:32 PM: β
12:22:32 PM: β― Version
12:22:32 PM: @netlify/build 29.17.4
12:22:32 PM: β
12:22:32 PM: β― Flags
12:22:32 PM: baseRelDir: true
12:22:32 PM: buildId: 64cd25ae2ca8572eaea961d7
12:22:32 PM: deployId: 64cd25ae2ca8572eaea961d9
12:22:32 PM: β
12:22:32 PM: β― Current directory
12:22:32 PM: /opt/build/repo
12:22:32 PM: β
12:22:32 PM: β― Config file
12:22:32 PM: No config file was defined: using default values.
12:22:32 PM: β
12:22:32 PM: β― Context
12:22:32 PM: production
12:22:32 PM: β
12:22:32 PM: Build command from Netlify app
12:22:32 PM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
12:22:32 PM: β
12:22:32 PM: $ npm install axios && npm run build
12:22:34 PM: added 3 packages, and audited 1505 packages in 2s
12:22:34 PM: 241 packages are looking for funding
12:22:34 PM: run `npm fund` for details
12:22:34 PM: 6 high severity vulnerabilities
12:22:34 PM: To address all issues (including breaking changes), run:
12:22:34 PM: npm audit fix --force
12:22:34 PM: Run `npm audit` for details.
12:22:34 PM: > [email protected] build
12:22:34 PM: > react-scripts build
12:22:35 PM: Creating an optimized production build...
12:22:43 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
12:22:39 PM: One of your dependencies, babel-preset-react-app, is importing the
12:22:39 PM: @babel/plugin-proposal-private-property-in-object package without
12:22:39 PM: declaring it in its dependencies. This is currently working because
12:22:39 PM: @babel/plugin-proposal-private-property-in-object is already in your
12:22:39 PM: node_modules folder for unrelated reasons, but it may break at any time.
12:22:39 PM: babel-preset-react-app is part of the create-react-app project, which
12:22:39 PM: is not maintianed anymore. It is thus unlikely that this bug will
12:22:39 PM: ever be fixed. Add @babel/plugin-proposal-private-property-in-object to
12:22:39 PM: your devDependencies to work around this error. This will make this message
12:22:39 PM: go away.
12:22:41 PM:
12:22:41 PM: Treating warnings as errors because process.env.CI = true.
12:22:41 PM: Most CI servers set it automatically.
12:22:41 PM:
12:22:41 PM: Failed to compile.
12:22:41 PM:
12:22:41 PM: [eslint]
12:22:41 PM: src/Forecast.js
12:22:41 PM: Line 1:27: 'useEffect' is defined but never used no-unused-vars
12:22:41 PM: β
12:22:41 PM: build.command failed
12:22:41 PM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
12:22:41 PM: β
12:22:41 PM: Error message
12:22:41 PM: Command failed with exit code 1: npm install axios && npm run build (https://ntl.fyi/exit-code-1)
12:22:41 PM: β
12:22:41 PM: Error location
12:22:41 PM: In Build command from Netlify app:
12:22:41 PM: npm install axios && npm run build
12:22:41 PM: β
12:22:41 PM: Resolved config
12:22:41 PM: build:
12:22:41 PM: command: npm install axios && npm run build
12:22:41 PM: commandOrigin: ui
12:22:41 PM: publish: /opt/build/repo/build
12:22:41 PM: publishOrigin: ui
12:22:42 PM: Caching artifacts
12:22:42 PM: Started saving node modules
12:22:42 PM: Finished saving node modules
12:22:42 PM: Started saving build plugins
12:22:42 PM: Finished saving build plugins
12:22:42 PM: Started saving corepack cache
12:22:42 PM: Finished saving corepack cache
12:22:42 PM: Started saving pip cache
12:22:42 PM: Finished saving pip cache
12:22:42 PM: Started saving emacs cask dependencies
12:22:42 PM: Finished saving emacs cask dependencies12:22:42 PM: Started saving maven dependencies
12:22:42 PM: Finished saving maven dependencies
12:22:42 PM: Started saving boot dependencies
12:22:42 PM: Finished saving boot dependencies
12:22:42 PM: Started saving rust rustup cache
12:22:42 PM: Finished saving rust rustup cache
12:22:42 PM: Started saving go dependencies
12:22:42 PM: Finished saving go dependencies
12:22:42 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
12:22:42 PM: Failing build: Failed to build site
12:22:43 PM: Finished processing build request in 35.178s