Deploy failed sites

11:57:49 AM: Creating an optimized production build…
11:57:57 AM: Failed to compile.
11:57:57 AM:
11:57:57 AM: Failed to minify the code from this file:
11:57:57 AM: ./node_modules/tslib/tslib.es6.js:296
11:57:57 AM: Read more here: create-react-app/README.md at main · facebook/create-react-app · GitHub
11:57:57 AM: ​
11:57:57 AM: “build.command” failed
11:57:57 AM: ────────────────────────────────────────────────────────────────
11:57:57 AM: ​
11:57:57 AM: Error message
11:57:57 AM: Command failed with exit code 1: CI= npm run build (Search results for '"non-zero exit code: 1"' - Netlify Support Forums)
11:57:57 AM: ​
11:57:57 AM: Error location
11:57:57 AM: In build.command from netlify.toml:
11:57:57 AM: CI= npm run build
11:57:57 AM: ​
11:57:57 AM: Resolved config
11:57:57 AM: build:
11:57:57 AM: command: CI= npm run build
11:57:57 AM: commandOrigin: config
11:57:57 AM: publish: /opt/build/repo/build
11:57:57 AM: publishOrigin: ui
11:57:57 AM: redirects:
11:57:59 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
11:57:59 AM: Failing build: Failed to build site
11:58:00 AM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2 (Search results for '"non-zero exit code: 2"' - Netlify Support Forums)
11:58:00 AM: Finished processing build request in 36.456s

I don’t know:((

I’m curious why the build is attempting to minify code in node_modules.

Are you able to share the link to the full build log? Can you share the repository you are deploying from too?

uhm i don’t know i’m new in these things and i’m trying to understand a bit but i can’t

  1. The link to the build log, this is found at the top of the page you copied the log from previously.

  2. Link to the repository you are deploying from on (e.g. GitHub, Bitbucket, etc.)

in theory it doesn’t show me the permalinks because it hasn’t been published… I have deployed one of my private repositories on github

Can you share the full build log then?

1:31:43 PM: build-image version: 4b067841aaa59ef71931d3505b98c2bc3e63f36f (focal)
1:31:43 PM: buildbot version: a97756545adbd82de83b06c902122c919d70e7f2
1:31:43 PM: Fetching cached dependencies
1:31:43 PM: Failed to fetch cache, continuing with build
1:31:43 PM: Starting to prepare the repo for build
1:31:43 PM: No cached dependencies found. Cloning fresh repo
1:31:43 PM: git clone --filter=blob:none https://github.com/MGMarcoGesualdi/MGPortfolio
1:31:44 PM: Preparing Git Reference refs/heads/master
1:31:46 PM: Starting to install dependencies
1:31:46 PM: Python version set to 3.8
1:31:46 PM: Attempting Ruby version 2.7.2, read from environment
1:31:47 PM: Using Ruby version 2.7.2
1:31:47 PM: Started restoring cached go cache
1:31:47 PM: Finished restoring cached go cache
1:31:48 PM: go version go1.19.9 linux/amd64
1:31:48 PM: Using PHP version 8.0
1:31:49 PM: v16.20.0 is already installed.
1:31:50 PM: Now using node v16.20.0 (npm v8.19.4)
1:31:50 PM: Enabling Node.js Corepack
1:31:50 PM: Started restoring cached build plugins
1:31:50 PM: Finished restoring cached build plugins
1:31:50 PM: Started restoring cached corepack dependencies
1:31:50 PM: Finished restoring cached corepack dependencies
1:31:50 PM: Started restoring cached yarn cache
1:31:50 PM: Finished restoring cached yarn cache
1:31:50 PM: No yarn workspaces detected
1:31:50 PM: Started restoring cached node modules
1:31:50 PM: Finished restoring cached node modules
1:31:50 PM: Installing npm packages using Yarn version 1.22.19
1:31:51 PM: yarn install v1.22.19
1:31:51 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.
1:31:51 PM: [1/4] Resolving packages…
1:31:51 PM: warning react-scripts > fsevents@1.2.13: The v1 package contains DANGEROUS / INSECURE binaries. Upgrade to safe fsevents v2
1:31:51 PM: warning react-scripts > webpack-dev-server > chokidar > fsevents@1.2.13: The v1 package contains DANGEROUS / INSECURE binaries. Upgrade to safe fsevents v2
1:31:51 PM: [2/4] Fetching packages…
1:31:59 PM: [3/4] Linking dependencies…
1:32:03 PM: [4/4] Building fresh packages…
1:32:04 PM: success Saved lockfile.
1:32:04 PM: Done in 12.96s.
1:32:04 PM: npm packages installed using Yarn
1:32:04 PM: Install dependencies script success
1:32:04 PM: Starting build script
1:32:05 PM: Detected 1 framework(s)
1:32:05 PM: “create-react-app” at version “1.1.5”
1:32:05 PM: Section completed: initializing
1:32:06 PM: ​
1:32:06 PM: Netlify Build
1:32:06 PM: ────────────────────────────────────────────────────────────────
1:32:06 PM: ​
1:32:06 PM: ❯ Version
1:32:06 PM: @netlify/build 29.11.6
1:32:06 PM: ​
1:32:06 PM: ❯ Flags
1:32:06 PM: baseRelDir: true
1:32:06 PM: buildId: 64733b9bc2068c291c81edc7
1:32:06 PM: deployId: 64733b9bc2068c291c81edc9
1:32:06 PM: ​
1:32:06 PM: ❯ Current directory
1:32:06 PM: /opt/build/repo
1:32:06 PM: ​
1:32:06 PM: ❯ Config file
1:32:06 PM: /opt/build/repo/netlify.toml
1:32:06 PM: ​
1:32:06 PM: ❯ Context
1:32:06 PM: production
1:32:06 PM: ​
1:32:06 PM: build.command from netlify.toml
1:32:06 PM: ────────────────────────────────────────────────────────────────
1:32:06 PM: ​
1:32:06 PM: $ CI= npm run build
1:32:06 PM: > my-portfolio@0.1.0 build
1:32:06 PM: > craco build
1:32:07 PM: Creating an optimized production build…
1:32:14 PM: Failed to compile.
1:32:14 PM:
1:32:14 PM: Failed to minify the code from this file:
1:32:14 PM: ./node_modules/tslib/tslib.es6.js:296
1:32:14 PM: Read more here: create-react-app/README.md at main · facebook/create-react-app · GitHub
1:32:14 PM: ​
1:32:14 PM: “build.command” failed
1:32:14 PM: ────────────────────────────────────────────────────────────────
1:32:14 PM: ​
1:32:14 PM: Error message
1:32:14 PM: Command failed with exit code 1: CI= npm run build (Search results for '"non-zero exit code: 1"' - Netlify Support Forums)
1:32:14 PM: ​
1:32:14 PM: Error location
1:32:14 PM: In build.command from netlify.toml:
1:32:14 PM: CI= npm run build
1:32:14 PM: ​
1:32:14 PM: Resolved config
1:32:14 PM: build:
1:32:14 PM: command: CI= npm run build
1:32:14 PM: commandOrigin: config
1:32:14 PM: publish: /opt/build/repo/build
1:32:14 PM: publishOrigin: ui
1:32:14 PM: redirects:
1:32:15 PM: - from: /*
status: 200
to: /index.html
redirectsOrigin: config
Caching artifacts
1:32:15 PM: Started saving node modules
1:32:15 PM: Finished saving node modules
1:32:15 PM: Started saving build plugins
1:32:15 PM: Finished saving build plugins
1:32:15 PM: Started saving corepack cache
1:32:15 PM: Finished saving corepack cache
1:32:15 PM: Started saving yarn cache
1:32:16 PM: Finished saving yarn cache
1:32:16 PM: Started saving pip cache
1:32:16 PM: Finished saving pip cache
1:32:16 PM: Started saving emacs cask dependencies
1:32:16 PM: Finished saving emacs cask dependencies
1:32:16 PM: Started saving maven dependencies
1:32:16 PM: Finished saving maven dependencies
1:32:16 PM: Started saving boot dependencies
1:32:16 PM: Finished saving boot dependencies
1:32:16 PM: Started saving rust rustup cache
1:32:16 PM: Finished saving rust rustup cache
1:32:16 PM: Started saving go dependencies
1:32:16 PM: Finished saving go dependencies
1:32:17 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
1:32:17 PM: Failing build: Failed to build site
1:32:17 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)
1:32:17 PM: Finished processing build request in 34.009s

Unfortunately it provides no clues as to what is happening and why. Without seeing/testing I couldn’t even make guesses.

honestly I wasn’t always fine either this time it gave me this error I thought it was a netlify compiler error but I don’t know

Please share a reproducible example for testing, @MGMarcoGesualdi.

like some kind of video?

No, a repo would be helpful.

This appears to be a problem with react-scripts v1: javascript - Failed to minify the code from this file - Stack Overflow and not Netlify

so maybe i have to update react scripts and qso when i go to deploy it goes wrong?

Yes, try upgrading your dependencies.

hi, I tried to recreate the project again I was missing something but when I do npm start on localhost it goes … I don’t know how I can go on

Try npm run build and see if you can build it. I couldn’t build your repo before.

Creating an optimized production build…
Failed to compile.

Failed to minify the code from this file:

    ./node_modules/tslib/tslib.es6.js:296 

Read more here: create-react-app/README.md at main · facebook/create-react-app · GitHub

it also says the same thing when i deploy

Yes exactly as I mentioned, this is not a Netlify issue, we can’t help you with debugging your code.

ah sorry okkei i’ll try to see then… i thought it was some netlify error