Home
Support Forums

The build failed because the process exited too early. This probably means the system ran out of memory or someone called `kill -9` on the process

Can you please help me with my build issue. Problems started in the end of last week. Even if I try with minimum changes I do not succed to create a build. I see no soluton in the error log nor find on Google.

3:33:52 PM: Build ready to start
3:33:54 PM: build-image version: b0258b965567defc4a2d7e2f2dec2e00c8f73ad6
3:33:54 PM: build-image tag: v3.4.1
3:33:54 PM: buildbot version: 0a44c930054be748eff0c581d346282fece89cc0
3:33:54 PM: Building without cache
3:33:54 PM: Starting to prepare the repo for build
3:33:55 PM: No cached dependencies found. Cloning fresh repo
3:33:55 PM: git clone https://github.com/xxxxx
3:33:56 PM: Preparing Git Reference refs/heads/npm-flux
3:33:57 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: 'build' versus '' in the Netlify UI
3:33:57 PM: Different functions path detected, going to use the one specified in the Netlify configuration file: 'built-lambda' versus '' in the Netlify UI
3:33:57 PM: Different build command detected, going to use the one specified in the Netlify configuration file: 'npm run build' versus '' in the Netlify UI
3:33:57 PM: Starting build script
3:33:57 PM: Installing dependencies
3:33:57 PM: Python version set to 2.7
3:33:58 PM: v12.18.0 is already installed.
3:33:59 PM: Now using node v12.18.0 (npm v6.14.4)
3:33:59 PM: Started restoring cached build plugins
3:33:59 PM: Finished restoring cached build plugins
3:33:59 PM: Attempting ruby version 2.7.1, read from environment
3:34:00 PM: Using ruby version 2.7.1
3:34:00 PM: Using PHP version 5.6
3:34:00 PM: 5.2 is already installed.
3:34:00 PM: Using Swift version 5.2
3:34:00 PM: Started restoring cached node modules
3:34:00 PM: Finished restoring cached node modules
3:34:01 PM: Installing NPM modules using NPM version 6.14.4
3:34:53 PM: > core-js@2.6.11 postinstall /opt/build/repo/node_modules/babel-runtime/node_modules/core-js
3:34:53 PM: > node -e "try{require('./postinstall')}catch(e){}"
3:34:54 PM: > core-js@3.6.5 postinstall /opt/build/repo/node_modules/core-js
3:34:54 PM: > node -e "try{require('./postinstall')}catch(e){}"
3:34:54 PM: > core-js-pure@3.6.5 postinstall /opt/build/repo/node_modules/core-js-pure
3:34:54 PM: > node -e "try{require('./postinstall')}catch(e){}"
3:34:54 PM: > protobufjs@6.10.1 postinstall /opt/build/repo/node_modules/protobufjs
3:34:54 PM: > node scripts/postinstall
3:34:55 PM: > core-js@2.6.11 postinstall /opt/build/repo/node_modules/recharts/node_modules/core-js
3:34:55 PM: > node -e "try{require('./postinstall')}catch(e){}"
3:34:56 PM: > netlify-cli@2.58.0 postinstall /opt/build/repo/node_modules/netlify-cli
3:34:56 PM: > node ./scripts/postinstall.js
3:34:56 PM: Success! Netlify CLI has been installed!
3:34:56 PM: Your device is now configured to use Netlify CLI to deploy and manage your Netlify sites.
3:34:56 PM: Next steps:
3:34:56 PM:   netlify init     Connect or create a Netlify site from current directory
3:34:56 PM:   netlify deploy   Deploy the latest changes to your Netlify site
3:34:56 PM: For more information on the CLI run netlify help
3:34:56 PM: Or visit the docs at https://cli.netlify.com
3:34:59 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/webpack-dev-server/node_modules/fsevents):
3:34:59 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
3:34:59 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/watchpack-chokidar2/node_modules/fsevents):
3:34:59 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
3:34:59 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/jest-haste-map/node_modules/fsevents):
3:34:59 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
3:34:59 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modules/fsevents):
3:34:59 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
3:34:59 PM: added 2700 packages from 1105 contributors and audited 2707 packages in 57.783s
3:35:02 PM: 98 packages are looking for funding
3:35:02 PM:   run `npm fund` for details
3:35:02 PM: found 45 vulnerabilities (34 low, 11 high)
3:35:02 PM:   run `npm audit fix` to fix them, or `npm audit` for details
3:35:02 PM: NPM modules installed
3:35:03 PM: Started restoring cached go cache
3:35:03 PM: Finished restoring cached go cache
3:35:03 PM: go version go1.14.4 linux/amd64
3:35:03 PM: go version go1.14.4 linux/amd64
3:35:03 PM: Installing missing commands
3:35:03 PM: Verify run directory
3:35:04 PM: ​
3:35:04 PM: ┌─────────────────────────────┐
3:35:04 PM: │        Netlify Build        │
3:35:04 PM: └─────────────────────────────┘
3:35:04 PM: ​
3:35:04 PM: ❯ Version
3:35:04 PM:   @netlify/build 5.0.2
3:35:04 PM: ​
3:35:04 PM: ❯ Flags
3:35:04 PM:   deployId: 5f96d040ae032f164ca1e5de
3:35:04 PM:   mode: buildbot
3:35:04 PM: ​
3:35:04 PM: ❯ Current directory
3:35:04 PM:   /opt/build/repo
3:35:04 PM: ​
3:35:04 PM: ❯ Config file
3:35:04 PM:   /opt/build/repo/netlify.toml
3:35:04 PM: ​
3:35:04 PM: ❯ Context
3:35:04 PM:   branch-deploy
3:35:05 PM: ​
3:35:05 PM: ┌────────────────────────────────────┐
3:35:05 PM: │ 1. build.command from netlify.toml │
3:35:05 PM: └────────────────────────────────────┘
3:35:05 PM: ​
3:35:05 PM: $ npm run build
3:35:05 PM: > create-react-app-lambda@0.5.0 build /opt/build/repo
3:35:05 PM: > run-p build:**
3:35:06 PM: > create-react-app-lambda@0.5.0 build:app /opt/build/repo
3:35:06 PM: > react-scripts build
3:35:06 PM: > create-react-app-lambda@0.5.0 build:lambda /opt/build/repo
3:35:06 PM: > netlify-lambda build src/lambda
3:35:06 PM: netlify-lambda: Building functions
3:35:08 PM: Creating an optimized production build...
3:38:51 PM: The build failed because the process exited too early. This probably means the system ran out of memory or someone called `kill -9` on the process.
3:38:51 PM: npm ERR! code ELIFECYCLE
3:38:51 PM: npm ERR! errno 1
3:38:51 PM: npm ERR! create-react-app-lambda@0.5.0 build:app: `react-scripts build`
3:38:51 PM: npm ERR! Exit status 1
3:38:51 PM: npm ERR!
3:38:51 PM: npm ERR! Failed at the create-react-app-lambda@0.5.0 build:app script.
3:38:51 PM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
3:38:51 PM: npm ERR! A complete log of this run can be found in:
3:38:51 PM: npm ERR!     /opt/buildhome/.npm/_logs/2020-10-26T13_38_51_754Z-debug.log
3:38:52 PM: ERROR: "build:app" exited with 1.
3:38:52 PM: npm ERR! code ELIFECYCLE
3:38:52 PM: npm ERR! errno 1
3:38:52 PM: npm ERR! create-react-app-lambda@0.5.0 build: `run-p build:**`
3:38:52 PM: npm ERR! Exit status 1
3:38:52 PM: npm ERR!
3:38:52 PM: npm ERR! Failed at the create-react-app-lambda@0.5.0 build script.
3:38:52 PM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
3:38:52 PM: npm ERR! A complete log of this run can be found in:
3:38:52 PM: npm ERR!     /opt/buildhome/.npm/_logs/2020-10-26T13_38_52_189Z-debug.log
3:38:52 PM: ​
3:38:52 PM: ┌─────────────────────────────┐
3:38:52 PM: │   "build.command" failed    │
3:38:52 PM: └─────────────────────────────┘
3:38:52 PM: ​
3:38:52 PM:   Error message
3:38:52 PM:   Command failed with exit code 1: npm run build
3:38:52 PM: ​
3:38:52 PM:   Error location
3:38:52 PM:   In build.command from netlify.toml:
3:38:52 PM:   npm run build
3:38:52 PM: ​
3:38:52 PM:   Resolved config
3:38:52 PM:   build:
3:38:52 PM:     command: npm run build
3:38:52 PM:     commandOrigin: config
3:38:52 PM:     functions: /opt/build/repo/built-lambda
3:38:52 PM:     publish: /opt/build/repo/build
3:38:52 PM: Caching artifacts
3:38:52 PM: Started saving node modules
3:38:52 PM: Finished saving node modules
3:38:52 PM: Started saving build plugins
3:38:52 PM: Finished saving build plugins
3:38:52 PM: Started saving pip cache
3:38:52 PM: Finished saving pip cache
3:38:52 PM: Started saving emacs cask dependencies
3:38:52 PM: Finished saving emacs cask dependencies
3:38:52 PM: Started saving maven dependencies
3:38:52 PM: Finished saving maven dependencies
3:38:52 PM: Started saving boot dependencies
3:38:52 PM: Finished saving boot dependencies
3:38:52 PM: Started saving go dependencies
3:38:52 PM: Finished saving go dependencies
3:38:55 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
3:38:55 PM: Failing build: Failed to build site
3:38:55 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2
3:38:55 PM: Finished processing build request in 5m0.836827249s

my netlify.toml

[build]

command = "npm run build" # the command you run to build this file

  functions = "built-lambda" # netlify-lambda builds to this folder AND Netlify reads functions from here

  publish = "build" # create-react-app builds to this folder, Netlify should serve all these files statically

sorry to be slow to reply, @mik-a.

First question - does this build locally?