Home
Support Forums

Build failing on netlify but builds fine locally

Our netlify build deploy is failing with the following error below. We can confirm that we can build locally. Can you please advise?

12:35:37 PM: > react-scripts build
12:35:39 PM: Creating an optimized production build...
12:42:20 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.
12:42:20 PM: npm ERR! code ELIFECYCLE
12:42:20 PM: npm ERR! errno 1
12:42:20 PM: npm ERR! mark10@0.1.0 build: `react-scripts build`
12:42:20 PM: npm ERR! Exit status 1
12:42:20 PM: npm ERR!
12:42:20 PM: npm ERR! Failed at the mark10@0.1.0 build script.
12:42:20 PM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
12:42:20 PM: npm ERR! A complete log of this run can be found in:
12:42:20 PM: npm ERR!     /opt/buildhome/.npm/_logs/2022-01-06T17_42_20_657Z-debug.log
12:42:20 PM: ​
12:42:20 PM: ────────────────────────────────────────────────────────────────
12:42:20 PM:   "build.command" failed                                        
12:42:20 PM: ────────────────────────────────────────────────────────────────
12:42:20 PM: ​
12:42:20 PM:   Error message
12:42:20 PM:   Command failed with exit code 1: npm run build
12:42:20 PM: ​
12:42:20 PM:   Error location
12:42:20 PM:   In Build command from Netlify app:
12:42:20 PM:   npm run build
12:42:20 PM: ​
12:42:20 PM:   Resolved config
12:42:20 PM:   build:
12:42:20 PM:     command: npm run build
12:42:20 PM:     commandOrigin: ui
12:42:20 PM:     environment:
12:42:20 PM:       - CANARY_REACT_APP_AUTH0_REDIRECT_URI
12:42:20 PM:       - NODE_OPTIONS
12:42:20 PM:       - REACT_APP_AG_GRID_KEY
12:42:20 PM:       - REACT_APP_API_IDENTIFIER
12:42:20 PM:       - REACT_APP_AUTH0_AUDIENCE
12:42:20 PM:       - REACT_APP_AUTH0_CLIENTID
12:42:20 PM:       - REACT_APP_AUTH0_DOMAIN
12:42:20 PM:       - REACT_APP_AUTH0_REDIRECT_URI
12:42:20 PM:       - REACT_APP_GA_TRACKING_ID
12:42:20 PM:       - REACT_APP_HOME
12:42:20 PM:       - REACT_APP_STRIPE_PUBLIC_KEY
12:42:20 PM:       - X_CANARY_REACT_APP_API_IDENTIFIER
12:42:20 PM:     publish: /opt/build/repo/build
12:42:20 PM:     publishOrigin: ui

Hiya, sorry you are having trouble with your build.

This Support Guide contains a ton of useful debugging tips that can likely help you solve your problem :slight_smile:

We also recommend trying to search the forums with the build error you encountered - it’s likely your question was already asked by someone else!

If you are still having problems, please provide as much information as you can on what you have already tried, what your build settings are, your package.json, etc. Thanks!