Deploy URL: Netlify App
Hi there,
I have an issue where I cannot deploy my website after the changes I made. I integrated stripe API and had to rewire React app because of web pack 5 and the support for polyfills. I tried clearing the cache, adding CI and giving it a value of ‘false’ in the environment variable section, changed my theme (apparently themes may cause these issues) and I did read lots of forums with similar issues, but none of the solutions worked. I will appreciate any help. Thank you and here is the error I am getting:
4:28:48 PM: build-image version: d7b3813f01c06610bc1723ff1b22446513ee7941 (focal)
4:28:48 PM: build-image tag: v4.14.3
4:28:48 PM: buildbot version: be0925a1b4e8f8d2c5a767f3e0decf8856cad273
4:28:48 PM: Building without cache
4:28:48 PM: Starting to prepare the repo for build
4:28:48 PM: No cached dependencies found. Cloning fresh repo
4:28:48 PM: git clone GitHub - magedmohammed834/crwn-clothing: E-commerce site for a clothing company
4:28:49 PM: Preparing Git Reference refs/heads/main
4:28:49 PM: Parsing package.json dependencies
4:28:50 PM: Starting build script
4:28:50 PM: Installing dependencies
4:28:50 PM: Python version set to 2.7
4:28:50 PM: Downloading and installing node v16.18.1…
4:28:50 PM: Downloading https://nodejs.org/dist/v16.18.1/node-v16.18.1-linux-x64.tar.xz…
4:28:51 PM: Computing checksum with sha256sum
4:28:51 PM: Checksums matched!
4:28:53 PM: Now using node v16.18.1 (npm v8.19.2)
4:28:53 PM: Enabling node corepack
4:28:53 PM: Started restoring cached build plugins
4:28:53 PM: Finished restoring cached build plugins
4:28:53 PM: Attempting ruby version 2.7.2, read from environment
4:28:53 PM: Using ruby version 2.7.2
4:28:54 PM: Using PHP version 8.0
4:28:54 PM: Started restoring cached go cache
4:28:54 PM: Finished restoring cached go cache
4:28:54 PM: Installing Go version 1.17 (requested 1.17)
4:28:58 PM: unset GOOS;
4:28:58 PM: unset GOARCH;
4:28:58 PM: export GOROOT=‘/opt/buildhome/.gimme/versions/go1.17.linux.amd64’;
4:28:58 PM: export PATH=“/opt/buildhome/.gimme/versions/go1.17.linux.amd64/bin:${PATH}”;
4:28:58 PM: go version >&2;
4:28:58 PM: export GIMME_ENV=“/opt/buildhome/.gimme/env/go1.17.linux.amd64.env”
4:28:58 PM: go version go1.17 linux/amd64
4:28:58 PM: Detected 0 framework(s)
4:28:58 PM: Installing missing commands
4:28:58 PM: Verify run directory
4:29:00 PM:
4:29:00 PM: ────────────────────────────────────────────────────────────────
4:29:00 PM: Netlify Build
4:29:00 PM: ────────────────────────────────────────────────────────────────
4:29:00 PM:
4:29:00 PM: ❯ Version
4:29:00 PM: @netlify/build 28.1.13
4:29:00 PM:
4:29:00 PM: ❯ Flags
4:29:00 PM: baseRelDir: true
4:29:00 PM: buildId: 636d6d0e1b30553a2c12263e
4:29:00 PM: deployId: 636d6d0e1b30553a2c122640
4:29:00 PM:
4:29:00 PM: ❯ Current directory
4:29:00 PM: /opt/build/repo
4:29:00 PM:
4:29:00 PM: ❯ Config file
4:29:00 PM: No config file was defined: using default values.
4:29:00 PM:
4:29:00 PM: ❯ Context
4:29:00 PM: production
4:29:00 PM:
4:29:00 PM: ────────────────────────────────────────────────────────────────
4:29:00 PM: 1. Build command from Netlify app
4:29:00 PM: ────────────────────────────────────────────────────────────────
4:29:00 PM:
4:29:00 PM: $ CI= npm run build
4:29:00 PM: npm ERR! code ENOENT
4:29:00 PM: npm ERR! syscall open
4:29:00 PM: npm ERR! path /opt/build/repo/package.json
4:29:00 PM: npm ERR! errno -2
4:29:00 PM: npm ERR! enoent ENOENT: no such file or directory, open ‘/opt/build/repo/package.json’
4:29:00 PM: npm ERR! enoent This is related to npm not being able to find a file.
4:29:00 PM: npm ERR! enoent
4:29:00 PM: npm ERR! A complete log of this run can be found in:
4:29:00 PM: npm ERR! /opt/buildhome/.npm/_logs/2022-11-10T21_29_00_250Z-debug-0.log
4:29:00 PM:
4:29:01 PM: Creating deploy upload records
4:29:00 PM: ────────────────────────────────────────────────────────────────
4:29:00 PM: “build.command” failed
4:29:00 PM: ────────────────────────────────────────────────────────────────
4:29:00 PM:
4:29:01 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)
4:29:00 PM: Error message
4:29:00 PM: Command failed with exit code 254: CI= npm run build (Search results for '"non-zero exit code: 254"' - Netlify Support Forums)
4:29:00 PM:
4:29:00 PM: Error location
4:29:00 PM: In Build command from Netlify app:
4:29:00 PM: CI= npm run build
4:29:00 PM:
4:29:00 PM: Resolved config
4:29:00 PM: build:
4:29:00 PM: command: CI= npm run build
4:29:00 PM: commandOrigin: ui
4:29:00 PM: environment:
4:29:00 PM: - CI
4:29:00 PM: - REACT_APP_STRIPE_PUBLISHABLE_KEY
4:29:00 PM: - STRIPE_SECRET_KEY
4:29:00 PM: publish: /opt/build/repo/build
4:29:00 PM: publishOrigin: ui
4:29:00 PM: Caching artifacts
4:29:00 PM: Started saving build plugins
4:29:00 PM: Finished saving build plugins
4:29:00 PM: Started saving pip cache
4:29:00 PM: Finished saving pip cache
4:29:00 PM: Started saving emacs cask dependencies
4:29:00 PM: Finished saving emacs cask dependencies
4:29:00 PM: Started saving maven dependencies
4:29:00 PM: Finished saving maven dependencies
4:29:00 PM: Started saving boot dependencies
4:29:00 PM: Finished saving boot dependencies
4:29:00 PM: Started saving rust rustup cache
4:29:00 PM: Finished saving rust rustup cache
4:29:00 PM: Started saving go dependencies
4:29:00 PM: Finished saving go dependencies
4:29:01 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
4:29:01 PM: Failing build: Failed to build site
4:29:01 PM: Finished processing build request in 13.411067984s