Home
Support Forums

Command failed with exit code 1: react-scripts build

Hello all, I’m having an issue with my build. I’m using the cli to do an init then deploy for my site epic-einstein-345930. The error below is what I get. My build is React and Firebase. Any suggestions on this deploy error fix would be greatly appreciated. Thanks! - Emit

12:35:35 PM: ────────────────────────────────────────────────────────────────
12:35:35 PM: β€œbuild.command” failed
12:35:35 PM: ────────────────────────────────────────────────────────────────
12:35:35 PM: ​
12:35:35 PM: Error message
12:35:35 PM: Command failed with exit code 1: react-scripts build
12:35:35 PM: ​
12:35:35 PM: Error location
12:35:35 PM: In Build command from Netlify app:
12:35:35 PM: react-scripts build
12:35:35 PM: ​
12:35:35 PM: Resolved config
12:35:35 PM: build:
12:35:35 PM: command: react-scripts build
12:35:35 PM: commandOrigin: ui
12:35:35 PM: publish: /opt/build/repo/build

My package.json:

{

β€œname”: β€œcotd”,

β€œversion”: β€œ0.0.3”,

β€œprivate”: true,

β€œdevDependencies”: {

"concurrently": "4.1.0",

"react-scripts": "3.4.1"

},

β€œdependencies”: {

"autoprefixer-stylus": "0.14.0",

"firebase": "^7.6.0",

"netlify-cli": "^3.9.0",

"prop-types": "^15.6.0",

"re-base": "4.0.0",

"react": "^16.6.3",

"react-dom": "^16.6.3",

"react-router-dom": "^4.2.2",

"react-transition-group": "^2.2.1",

"serve": "^10.1.2",

"stylus": "0.54.5"

},

β€œscripts”: {

"dev": "react-scripts start",

"start": "react-scripts start",

"watch": "concurrently --names \"webpack, stylus\" --prefix name \"npm run start\" \"npm run styles:watch\"",

"build": "react-scripts build",

"eject": "react-scripts eject",

"styles": "stylus -u autoprefixer-stylus ./src/css/style.styl -o ./src/css/style.css",

"now-build": "npm run build && mv build dist",

"styles:watch": "npm run styles -- -w"

},

β€œbrowserslist”: [

">0.2%",

"not ie <= 11",

"not op_mini all"

]

}

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!

Thanks, will do. I did list my package.json above, if that helps.

Looks like in the build command, I needed to change it to:

CI= react-scripts build

All done! Fixed and it deployed.

1 Like