Home
Support Forums

Build Command Error with npm run build

I’m trying to deploy my page and I’m getting this error.

────────────────────────────────────────────────────────────────
12:23:55 PM: “build.command” failed
12:23:55 PM: ────────────────────────────────────────────────────────────────
12:23:55 PM: ​
12:23:55 PM: Error message
12:23:55 PM: Command failed with exit code 254: npm run build
12:23:55 PM: ​
12:23:55 PM: Error location
12:23:55 PM: In Build command from Netlify app:
12:23:55 PM: npm run build
12:23:55 PM: ​
12:23:55 PM: Resolved config
12:23:55 PM: build:
12:23:55 PM: command: npm run build
12:23:55 PM: commandOrigin: ui
12:23:55 PM: publish: /opt/build/repo/build

Kindly post the full build log.

I’d always suggest starting from this guide, @ToxicMorty2019:

As @hrishikesh asked, the minimum we’d need to advise would be a full build log, but hopefully you can instead answer the questions at the bottom of that post after trying the steps in it to fix your build :slight_smile:

I am also having issues with the npm run build command and need support

8:20:55 PM: Error message
8:20:55 PM: Command failed with exit code 1: CI= npm run build
8:20:55 PM: ​
8:20:55 PM: Error location
8:20:55 PM: In Build command from Netlify app:
8:20:55 PM: CI= npm run build
8:20:55 PM: ​
8:20:55 PM: Resolved config

I have tried
CI=false npm run build
CI=true npm run build
CI= npm run build
npm run build

none of the above worked!

the strength thing is that the build worked previously with the CI= npm run build and now thoughts this error

https://dev.carhero.com is the link for the site if needed!

@fool can you help
Thanks

Hi @oppenberger

Can you provide a link to your deploy log (if logs are public) or post your full log. Partial logs don’t tell the full story.

Also, is your git repository public? If so, can you share the URL?

Hi @coelmay ,

after carefully going over the build log I was able to track down the root of the issue ( bad environment variable ) and solve it.

I greatly apologize for waisting your time and appreciate your quick response

1 Like

Great to hear you were able to solve the issue yourself :partying_face:

No apology needed.