Failed during stage 'building site': Build script returned non-zero exit code: 2 netlify

  *******  I have a problem while deploying on netlify. Please help..  *******

8:24:08 PM: 3. @netlify/plugin-nextjs (onBuild event)
8:24:08 PM: ────────────────────────────────────────────────────────────────
8:24:08 PM: ​
8:24:08 PM: ​
8:24:08 PM: ────────────────────────────────────────────────────────────────
8:24:08 PM: Plugin “@netlify/plugin-nextjs” failed
8:24:09 PM: Creating deploy upload records
8:24:08 PM: ────────────────────────────────────────────────────────────────
8:24:08 PM: ​
8:24:08 PM: Error message
8:24:08 PM: Error: The directory “/opt/build/repo/.next” does not contain a Next.js production build. Perhaps the build command was not run, or you specified the wrong publish directory.
8:24:08 PM: In most cases it should be set to “.next”, unless you have chosen a custom “distDir” in your Next config.
8:24:10 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)
8:24:08 PM: If you are using “next export” then you should set the environment variable NETLIFY_NEXT_PLUGIN_SKIP to “true”.
8:24:08 PM: ​
8:24:08 PM: Plugin details
8:24:08 PM: Package: @netlify/plugin-nextjs
8:24:08 PM: Version: 4.15.0
8:24:08 PM: Repository: git+https://github.com/netlify/netlify-plugin-nextjs.git
8:24:08 PM: npm link: @netlify/plugin-nextjs - npm
8:24:08 PM: Report issues: Issues · netlify/next-runtime · GitHub
8:24:08 PM: ​
8:24:08 PM: Error location
8:24:08 PM: In “onBuild” event in “@netlify/plugin-nextjs” from Netlify app and package.json
8:24:08 PM: at checkNextSiteHasBuilt (/node_modules/@netlify/plugin-nextjs/lib/helpers/verification.js:82:16)
8:24:08 PM: at onBuild (/node_modules/@netlify/plugin-nextjs/lib/index.js:42:50)
8:24:08 PM: ​
8:24:08 PM: Resolved config
8:24:08 PM: build:
8:24:08 PM: command: npm run
8:24:08 PM: commandOrigin: ui
8:24:08 PM: environment:
8:24:08 PM: - NEXT_PRIVATE_TARGET
8:24:08 PM: publish: /opt/build/repo/.next
8:24:08 PM: publishOrigin: ui
8:24:08 PM: plugins:
8:24:08 PM: - inputs: {}
8:24:08 PM: origin: ui
8:24:08 PM: package: ‘@netlify/plugin-nextjs’
8:24:08 PM: Caching artifacts
8:24:08 PM: Started saving node modules
8:24:08 PM: Finished saving node modules
8:24:08 PM: Started saving build plugins
8:24:09 PM: Finished saving build plugins
8:24:09 PM: Started saving pip cache
8:24:09 PM: Finished saving pip cache
8:24:09 PM: Started saving emacs cask dependencies
8:24:09 PM: Finished saving emacs cask dependencies
8:24:09 PM: Started saving maven dependencies
8:24:09 PM: Finished saving maven dependencies
8:24:09 PM: Started saving boot dependencies
8:24:09 PM: Finished saving boot dependencies
8:24:09 PM: Started saving rust rustup cache
8:24:09 PM: Finished saving rust rustup cache
8:24:09 PM: Started saving go dependencies
8:24:09 PM: Finished saving go dependencies
8:24:09 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
8:24:10 PM: Failing build: Failed to build site
8:24:10 PM: Finished processing build request in 31.713480941s

The problem has been explained in these lines. If you think that’s incorrect, please share your site name.

this is my site name ‘dawwas-portfolio’.

The problem is, you’re running npm run as your build command: Netlify App. This is incorrect.

Change it here: Netlify App to npm run build.

I was using ‘npm run build’, but this is what happened

8:56:41 PM: 2. Build command from Netlify app
8:56:41 PM: ────────────────────────────────────────────────────────────────
8:56:41 PM: ​
8:56:41 PM: $ npm run build
8:56:41 PM: npm WARN config tmp This setting is no longer used. npm stores temporary files in a special
8:56:41 PM: npm WARN config location in the cache, and they are managed by
8:56:41 PM: npm WARN config cacache.
8:56:41 PM: > craftzdog-homepage@1.0.0 build
8:56:41 PM: > next build
8:56:42 PM: info - SWC minify release candidate enabled. swc-minify-enabled | Next.js
8:56:42 PM: info - Linting and checking validity of types…
8:56:44 PM:
8:56:44 PM: Failed to compile.
8:56:44 PM: ./pages/index.js
8:56:44 PM: 42:24 Error: ' can be escaped with ', ‘, ', ’. react/no-unescaped-entities
8:56:44 PM: ./pages/works.js
8:56:44 PM: 1:42 Error: ‘Divider’ is defined but never used. Allowed unused vars must match /^_/u. no-unused-vars
8:56:44 PM: info - Need to disable some ESLint rules? Learn more here: Basic Features: ESLint | Next.js
8:56:44 PM: ​
8:56:44 PM: ────────────────────────────────────────────────────────────────
8:56:44 PM: “build.command” failed
8:56:44 PM: ────────────────────────────────────────────────────────────────
8:56:44 PM: ​
8:56:44 PM: Error message
8:56:44 PM: Command failed with exit code 1: npm run build (Search results for '"non-zero exit code: 1"' - Netlify Support Forums)
8:56:44 PM: ​
8:56:44 PM: Error location
8:56:44 PM: In Build command from Netlify app:
8:56:44 PM: npm run build
8:56:44 PM: ​
8:56:44 PM: Resolved config
8:56:44 PM: build:
8:56:44 PM: command: npm run build
8:56:44 PM: commandOrigin: ui
8:56:44 PM: environment:
8:56:44 PM: - NEXT_PRIVATE_TARGET
8:56:44 PM: publish: /opt/build/repo/.next
8:56:44 PM: publishOrigin: ui
8:56:44 PM: plugins:
8:56:44 PM: - inputs: {}
8:56:44 PM: origin: ui
8:56:44 PM: package: ‘@netlify/plugin-nextjs’
8:56:44 PM: Caching artifacts
8:56:45 PM: Creating deploy upload records
8:56:44 PM: Started saving node modules
8:56:44 PM: Finished saving node modules
8:56:44 PM: Started saving build plugins
8:56:44 PM: Finished saving build plugins
8:56:44 PM: Started saving pip cache
8:56:45 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)
8:56:44 PM: Finished saving pip cache
8:56:44 PM: Started saving emacs cask dependencies
8:56:44 PM: Finished saving emacs cask dependencies
8:56:44 PM: Started saving maven dependencies
8:56:44 PM: Finished saving maven dependencies
8:56:44 PM: Started saving boot dependencies
8:56:44 PM: Finished saving boot dependencies
8:56:44 PM: Started saving rust rustup cache
8:56:44 PM: Finished saving rust rustup cache
8:56:44 PM: Started saving go dependencies
8:56:44 PM: Finished saving go dependencies
8:56:45 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
8:56:45 PM: Failing build: Failed to build site
8:56:46 PM: Finished processing build request in 41.492668148s

The problems are here and

If you want to ignore those warnings, try going to on the link in the logs:


But there i’m using &apos(in line 36). Then, there’s no ‘Divider’ in my code.

Well, it must exist somewhere for Next.js to complain about it. But as I said, you can skip refactoring this, but disabling the ESLint rules:

I try this

But, still have problem
11:11:50 PM: 2. Build command from Netlify app
11:11:50 PM: ────────────────────────────────────────────────────────────────
11:11:50 PM: ​
11:11:50 PM: $ npm run build
11:11:50 PM: npm WARN config tmp This setting is no longer used. npm stores temporary files in a special
11:11:50 PM: npm WARN config location in the cache, and they are managed by
11:11:50 PM: npm WARN config cacache.
11:11:50 PM: > craftzdog-homepage@1.0.0 build
11:11:50 PM: > next build
11:11:50 PM: info - SWC minify release candidate enabled. swc-minify-enabled | Next.js
11:11:50 PM: info - Linting and checking validity of types…
11:11:52 PM:
11:11:52 PM: Failed to compile.
11:11:52 PM: ./pages/index.js
11:11:52 PM: 42:24 Error: ' can be escaped with ', ‘, ', ’. react/no-unescaped-entities
11:11:52 PM: ./pages/works.js
11:11:52 PM: 1:42 Error: ‘Divider’ is defined but never used. Allowed unused vars must match /^_/u. no-unused-vars
11:11:52 PM: info - Need to disable some ESLint rules? Learn more here: Basic Features: ESLint | Next.js
11:11:53 PM: ​
11:11:53 PM: ────────────────────────────────────────────────────────────────
11:11:53 PM: “build.command” failed
11:11:53 PM: ────────────────────────────────────────────────────────────────
11:11:53 PM: ​
11:11:53 PM: Error message
11:11:53 PM: Command failed with exit code 1: npm run build (Search results for '"non-zero exit code: 1"' - Netlify Support Forums)
11:11:53 PM: ​
11:11:53 PM: Error location
11:11:53 PM: In Build command from Netlify app:
11:11:53 PM: npm run build
11:11:53 PM: ​
11:11:53 PM: Resolved config
11:11:53 PM: build:
11:11:53 PM: command: npm run build
11:11:53 PM: commandOrigin: ui
11:11:53 PM: environment:
11:11:53 PM: - NEXT_PRIVATE_TARGET
11:11:53 PM: publish: /opt/build/repo/.next
11:11:53 PM: publishOrigin: ui
11:11:53 PM: plugins:
11:11:53 PM: - inputs: {}
11:11:53 PM: origin: ui
11:11:54 PM: Creating deploy upload records
11:11:53 PM: package: ‘@netlify/plugin-nextjs’
11:11:53 PM: Caching artifacts
11:11:53 PM: Started saving node modules
11:11:53 PM: Finished saving node modules
11:11:54 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)
11:11:53 PM: Started saving build plugins
11:11:53 PM: Finished saving build plugins
11:11:53 PM: Started saving pip cache
11:11:53 PM: Finished saving pip cache
11:11:53 PM: Started saving emacs cask dependencies
11:11:53 PM: Finished saving emacs cask dependencies
11:11:53 PM: Started saving maven dependencies
11:11:53 PM: Finished saving maven dependencies
11:11:53 PM: Started saving boot dependencies
11:11:53 PM: Finished saving boot dependencies
11:11:53 PM: Started saving rust rustup cache
11:11:53 PM: Finished saving rust rustup cache
11:11:53 PM: Started saving go dependencies
11:11:53 PM: Finished saving go dependencies
11:11:54 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
11:11:54 PM: Failing build: Failed to build site
11:11:54 PM: Finished processing build request in 36.481528496s

The docs provide an example, you need to disable rules for your particular site:

During build I have this trouble, could you help me please

12:16:15 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
12:16:00 PM: Netlify Build                                                 
12:16:00 PM: ────────────────────────────────────────────────────────────────
12:16:00 PM: ​
12:16:00 PM: ❯ Version
12:16:00 PM:   @netlify/build 29.15.6
12:16:00 PM: ​
12:16:00 PM: ❯ Flags
12:16:00 PM:   baseRelDir: true
12:16:00 PM:   buildId: 64ae7d264979230fa391de02
12:16:00 PM:   deployId: 64ae7d264979230fa391de04
12:16:00 PM: ​
12:16:00 PM: ❯ Current directory
12:16:00 PM:   /opt/build/repo
12:16:00 PM: ​
12:16:00 PM: ❯ Config file
12:16:00 PM:   No config file was defined: using default values.
12:16:00 PM: ​
12:16:00 PM: ❯ Context
12:16:00 PM:   production
12:16:00 PM: ​
12:16:00 PM: Build command from Netlify app                                
12:16:00 PM: ────────────────────────────────────────────────────────────────
12:16:00 PM: ​
12:16:00 PM: $ yarn build
12:16:00 PM: yarn run v1.22.19
12:16:00 PM: $ react-scripts build
12:16:01 PM: Creating an optimized production build...
12:16:04 PM: One of your dependencies, babel-preset-react-app, is importing the
12:16:04 PM: @babel/plugin-proposal-private-property-in-object package without
12:16:04 PM: declaring it in its dependencies. This is currently working because
12:16:04 PM: @babel/plugin-proposal-private-property-in-object is already in your
12:16:04 PM: node_modules folder for unrelated reasons, but it may break at any time.
12:16:04 PM: babel-preset-react-app is part of the create-react-app project, which
12:16:04 PM: is not maintianed anymore. It is thus unlikely that this bug will
12:16:04 PM: ever be fixed. Add @babel/plugin-proposal-private-property-in-object to
12:16:04 PM: your devDependencies to work around this error. This will make this message
12:16:04 PM: go away.
12:16:10 PM: 
12:16:10 PM: Treating warnings as errors because process.env.CI = true.
12:16:10 PM: Most CI servers set it automatically.
12:16:10 PM: 
12:16:10 PM: Failed to compile.
12:16:10 PM: 
12:16:10 PM: [eslint]
12:16:10 PM: src/components/footer/Footer.jsx
12:16:10 PM:   Line 10:15:  The href attribute requires a valid value to be accessible. Provide a valid, navigable address as the href value. If you cannot provide a valid href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/anchor-is-valid.md  jsx-a11y/anchor-is-valid
12:16:10 PM:   Line 11:15:  The href attribute requires a valid value to be accessible. Provide a valid, navigable address as the href value. If you cannot provide a valid href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/anchor-is-valid.md  jsx-a11y/anchor-is-valid
12:16:10 PM:   Line 12:15:  The href attribute requires a valid value to be accessible. Provide a valid, navigable address as the href value. If you cannot provide a valid href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/anchor-is-valid.md  jsx-a11y/anchor-is-valid
12:16:10 PM: error Command failed with exit code 1. (https://ntl.fyi/exit-code-1)
12:16:10 PM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
12:16:10 PM: ​
12:16:10 PM: build.command failed                                        
12:16:10 PM: ────────────────────────────────────────────────────────────────
12:16:10 PM: ​
12:16:10 PM:   Error message
12:16:10 PM:   Command failed with exit code 1: yarn build (https://ntl.fyi/exit-code-1)
12:16:10 PM: ​
12:16:10 PM:   Error location
12:16:10 PM:   In Build command from Netlify app:
12:16:10 PM:   yarn build
12:16:10 PM: ​
12:16:10 PM:   Resolved config
12:16:10 PM:   build:
12:16:10 PM:     command: yarn build
12:16:10 PM:     commandOrigin: ui
12:16:10 PM:     publish: /opt/build/repo/build
12:16:10 PM:     publishOrigin: ui
12:16:15 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
12:16:15 PM: Failing build: Failed to build site
12:16:16 PM: Finished processing bui

@bayramsch As it says:

12:16:10 PM: Treating warnings as errors because process.env.CI = true.
12:16:10 PM: Most CI servers set it automatically.

The default is that CI is true and when that’s the case warnings are treated as errors and errors cause your build to fail.

You can see there are then some warnings concerning the src/components/footer/Footer.jsx file.

The easiest way to set it to false would be to change your build command to CI= yarn build

Sory but I didn’t understand, what it means CI=true
I just changed scripts “build” : “yarn build” in package.json and this time I get this error

12:56:51 PM: Failed during stage 'building site': Build script returned non-zero exit code: 137 (https://ntl.fyi/exit-code-137)
12:55:24 PM: Netlify Build                                                 
12:55:24 PM: ────────────────────────────────────────────────────────────────
12:55:24 PM: ​
12:55:24 PM: ❯ Version
12:55:24 PM:   @netlify/build 29.15.6
12:55:24 PM: ​
12:55:24 PM: ❯ Flags
12:55:24 PM:   baseRelDir: true
12:55:24 PM:   buildId: 64ae867e9a830d00083130f2
12:55:24 PM:   deployId: 64ae867e9a830d00083130f4
12:55:24 PM: ​
12:55:24 PM: ❯ Current directory
12:55:24 PM:   /opt/build/repo
12:55:24 PM: ​
12:55:24 PM: ❯ Config file
12:55:24 PM:   No config file was defined: using default values.
12:55:24 PM: ​
12:55:24 PM: ❯ Context
12:55:24 PM:   production
12:55:24 PM: ​
12:55:24 PM: Build command from Netlify app                                
12:55:24 PM: ────────────────────────────────────────────────────────────────
12:55:24 PM: ​
12:55:24 PM: $ yarn build
12:55:25 PM: yarn run v1.22.19
12:55:25 PM: $ yarn build
12:55:25 PM: $ yarn build
12:55:25 PM: $ yarn build
12:55:25 PM: $ yarn build
12:55:26 PM: $ yarn build
12:55:26 PM: $ yarn build
12:55:26 PM: $ yarn build
12:55:26 PM: $ yarn build
12:55:26 PM: $ yarn build
12:55:27 PM: $ yarn build
12:55:27 PM: $ yarn build
12:55:27 PM: $ yarn build
12:55:27 PM: $ yarn build
12:55:27 PM: $ yarn build
12:55:28 PM: $ yarn build
12:55:28 PM: $ yarn build
12:55:28 PM: $ yarn build
12:55:28 PM: $ yarn build
12:55:29 PM: $ yarn build
12:55:29 PM: $ yarn build
12:55:29 PM: $ yarn build
12:55:29 PM: $ yarn build
12:55:30 PM: $ yarn build
12:55:30 PM: $ yarn build
12:55:30 PM: $ yarn build
12:55:30 PM: $ yarn build
12:55:30 PM: $ yarn build
12:55:31 PM: $ yarn build
12:55:31 PM: $ yarn build
12:55:31 PM: $ yarn build
12:55:31 PM: $ yarn build
12:55:32 PM: $ yarn build
12:55:32 PM: $ yarn build
12:55:32 PM: $ yarn build
12:55:32 PM: $ yarn build
12:55:33 PM: $ yarn build
12:55:33 PM: $ yarn build
12:55:33 PM: $ yarn build
12:55:33 PM: $ yarn build
12:55:34 PM: $ yarn build
12:55:34 PM: $ yarn build
12:55:34 PM: $ yarn build
12:55:34 PM: $ yarn build
12:55:34 PM: $ yarn build
12:55:35 PM: $ yarn build
12:55:35 PM: $ yarn build
12:55:35 PM: $ yarn build
12:55:35 PM: $ yarn build
12:55:35 PM: $ yarn build
12:55:36 PM: $ yarn build
12:55:36 PM: $ yarn build
12:55:36 PM: $ yarn build
12:55:36 PM: $ yarn build
12:55:37 PM: $ yarn build
12:55:37 PM: $ yarn build
12:55:37 PM: $ yarn build
12:55:37 PM: $ yarn build
12:55:37 PM: $ yarn build
12:55:38 PM: $ yarn build
12:55:38 PM: $ yarn build
12:55:38 PM: $ yarn build
12:55:38 PM: $ yarn build
12:55:38 PM: $ yarn build
12:55:38 PM: $ yarn build
12:55:39 PM: $ yarn build
12:55:39 PM: $ yarn build
12:55:39 PM: $ yarn build
12:55:39 PM: $ yarn build
12:55:40 PM: $ yarn build
12:55:40 PM: $ yarn build
12:55:40 PM: $ yarn build
12:55:40 PM: $ yarn build
12:55:41 PM: $ yarn build
12:55:41 PM: $ yarn build
12:55:41 PM: $ yarn build
12:55:41 PM: $ yarn build
12:55:41 PM: $ yarn build
12:55:42 PM: $ yarn build
12:55:42 PM: $ yarn build
12:55:42 PM: $ yarn build
12:55:42 PM: $ yarn build
12:55:43 PM: $ yarn build
12:55:43 PM: $ yarn build
12:55:43 PM: $ yarn build
12:55:43 PM: $ yarn build
12:55:43 PM: $ yarn build
12:55:44 PM: $ yarn build
12:55:44 PM: $ yarn build
12:55:44 PM: $ yarn build
12:55:44 PM: $ yarn build
12:55:45 PM: $ yarn build
12:55:45 PM: $ yarn build
12:55:45 PM: $ yarn build
12:55:45 PM: $ yarn build
12:55:46 PM: $ yarn build
12:55:46 PM: $ yarn build
12:55:46 PM: $ yarn build
12:55:46 PM: $ yarn build
12:55:46 PM: $ yarn build
12:55:47 PM: $ yarn build
12:55:47 PM: $ yarn build
12:55:47 PM: $ yarn build
12:55:47 PM: $ yarn build
12:55:48 PM: $ yarn build
12:55:48 PM: $ yarn build
12:55:48 PM: $ yarn build
12:55:48 PM: $ yarn build
12:55:49 PM: $ yarn build
12:55:49 PM: $ yarn build
12:55:49 PM: $ yarn build
12:55:49 PM: $ yarn build
12:55:49 PM: $ yarn build
12:55:50 PM: $ yarn build
12:55:50 PM: $ yarn build
12:55:50 PM: $ yarn build
12:55:50 PM: $ yarn build
12:55:51 PM: $ yarn build
12:55:51 PM: $ yarn build
12:55:51 PM: $ yarn build
12:55:51 PM: $ yarn build
12:55:51 PM: $ yarn build
12:55:52 PM: $ yarn build
12:55:52 PM: $ yarn build
12:55:52 PM: $ yarn build
12:55:52 PM: $ yarn build
12:55:53 PM: $ yarn build
12:55:53 PM: $ yarn build
12:55:53 PM: $ yarn build
12:55:53 PM: $ yarn build
12:55:53 PM: $ yarn build
12:55:54 PM: $ yarn build
12:55:54 PM: $ yarn build
12:55:54 PM: $ yarn build
12:55:54 PM: $ yarn build
12:55:55 PM: $ yarn build
12:55:55 PM: $ yarn build
12:55:55 PM: $ yarn build
12:55:55 PM: $ yarn build
12:55:56 PM: $ yarn build
12:55:56 PM: $ yarn build
12:55:56 PM: $ yarn build
12:55:56 PM: $ yarn build
12:55:56 PM: $ yarn build
12:55:57 PM: $ yarn build
12:55:57 PM: $ yarn build
12:55:57 PM: $ yarn build
12:55:58 PM: $ yarn build
12:55:58 PM: $ yarn build
12:55:58 PM: $ yarn build
12:55:58 PM: $ yarn build
12:55:59 PM: $ yarn build
12:55:59 PM: $ yarn build
12:55:59 PM: $ yarn build
12:55:59 PM: $ yarn build
12:56:00 PM: $ yarn build
12:56:00 PM: $ yarn build
12:56:03 PM: /opt/build-bin/build: line 126:  3771 Killed                  FORCE_COLOR=1 $netlify_build_node_bin $netlify_build_bin --cwd=$repository_root --repositoryRoot=$repository_root --config=$configuration_file_path --branch=$branch --siteId=$site_id --defaultConfig=$default_config --baseRelDir=$base_rel_dir --context=$context --node-path=$user_node_path --cachedConfigPath=$cached_netlify_build_config_file --api-host=$netlify_endpoint --token=$netlify_token --build-id=$BUILD_ID --deploy-id=$DEPLOY_ID --mode=buildbot --telemetry=$build_telemetry --send-status --save-config --statsd.host=$HOST_NODE_IP --statsd.port=$STATSD_PORT --tracing.enabled=$tracing_enabled --tracing.host=$HOST_NODE_IP --tracing.traceId=$trace_id --tracing.parentSpanId=$parent_span_id --tracing.traceFlags=$trace_flags --functions-dist-dir=$functions_dist_dir --edge-functions-dist-dir=$edge_functions_dist_dir --cache-dir=$cache_dir --buildbot-server-socket=$buildbot_server_socket --framework=$framework --feature-flags=$feature_flags --testOpts.silentLingeringProcesses=$SILENT_LINGERING_PROCESSES --system-log-file=$system_log_file --explicit-secret-keys=$explicit_secret_keys
12:56:03 PM: $ yarn build
12:56:03 PM: $ yarn build
12:56:05 PM: Killed
12:56:08 PM: error Command failed with exit code 137. (https://ntl.fyi/exit-code-137)
12:56:08 PM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
12:56:08 PM: Killed
12:56:08 PM: error Command failed with exit code 137. (https://ntl.fyi/exit-code-137)
12:56:08 PM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
12:56:08 PM: error Command failed with exit code 137. (https://ntl.fyi/exit-code-137)
12:56:08 PM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
12:56:08 PM: error Command failed with exit code 137. (https://ntl.fyi/exit-code-137)
12:56:08 PM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
12:56:08 PM: error Command failed with exit code 137. (https://ntl.fyi/exit-code-137)
12:56:08 PM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
12:56:08 PM: $ yarn build
12:56:09 PM: $ yarn build
12:56:09 PM: $ yarn build
12:56:09 PM: $ yarn build
12:56:10 PM: $ yarn build
12:56:10 PM: $ yarn build
12:56:10 PM: $ yarn build
12:56:11 PM: $ yarn build
12:56:11 PM: error Command failed with exit code 137. (https://ntl.fyi/exit-code-137)
12:56:11 PM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
12:56:11 PM: Killed
12:56:11 PM: error Command failed with exit code 137. (https://ntl.fyi/exit-code-137)
12:56:11 PM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
12:56:11 PM: error Command failed with exit code 137. (https://ntl.fyi/exit-code-137)
12:56:11 PM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
12:56:11 PM: error Command failed with exit code 137. (https://ntl.fyi/exit-code-137)
12:56:11 PM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
12:56:11 PM: error Command failed with exit code 137. (https://ntl.fyi/exit-code-137)
12:56:11 PM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
12:56:11 PM: error Command failed with exit code 137. (https://ntl.fyi/exit-code-137)
12:56:11 PM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
12:56:11 PM: error Command failed with exit code 137. (https://ntl.fyi/exit-code-137)
12:56:11 PM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
12:56:11 PM: error Command failed with exit code 137. (https://ntl.fyi/exit-code-137)
12:56:11 PM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
12:56:11 PM: error Command failed with exit code 137. (https://ntl.fyi/exit-code-137)
12:56:11 PM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
12:56:11 PM: error Command failed with exit code 137. (https://ntl.fyi/exit-code-137)
12:56:11 PM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
12:56:11 PM: error Command failed with exit code 137. (https://ntl.fyi/exit-code-137)
12:56:11 PM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
12:56:11 PM: error Command failed with exit code 137. (https://ntl.fyi/exit-code-137)
12:56:11 PM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
12:56:11 PM: error Command failed with exit code 137. (https://ntl.fyi/exit-code-137)
12:56:11 PM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
12:56:11 PM: $ yarn build
12:56:11 PM: error Command failed with exit code 137. (https://ntl.fyi/exit-code-137)
12:56:11 PM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
12:56:11 PM: error Command failed with exit code 137. (https://ntl.fyi/exit-code-137)
12:56:11 PM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
12:56:11 PM: error Command failed with exit code 137. (https://ntl.fyi/exit-code-137)
12:56:11 PM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
12:56:11 PM: error Command failed with exit code 137. (https://ntl.fyi/exit-code-137)
12:56:11 PM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
12:56:11 PM: error Command failed with exit code 137. (https://ntl.fyi/exit-code-137)
12:56:11 PM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
12:56:11 PM: error Command failed with exit code 137. (https://ntl.fyi/exit-code-137)
12:56:11 PM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
12:56:51 PM: Error running command: Build script returned non-zero exit code: 137
12:56:51 PM: Failing build: Failed to build site
12:56:52 PM: Finished processing build request in 1m55.946s

@bayramsch I’m perplexed as to how you read what I wrote, and then tried that.

I didn’t tell you to change the build script in your package.json, I mentioned nothing about the package.json at all, all you’ve succeeded in doing is creating an infinite loop.

Leave your package.json build script as whatever it was.

Change your Netlify Build command in your Basic build settings from yarn build to CI= yarn build

Thank you very much. I realized my mistake before you wrote it and it’s working now. Sometimes people get blocked:)

@bayramsch It’s no problem at all, I’ve realised that you had just misinterpreted my unclear use of the Netlify term Build command with the “build script in the package.json”, which is very much a “build command”.

Usually I make Build command bold and link to the documentation, but I’d forgotten to in my haste to answer, sorry for the confusion!

1 Like

Glad to hear you found your solution! What a great community interaction. :grinning: