Home
Support Forums

Error build command

PLEASE help us help you by writing a good post!

11:03:01 AM: ────────────────────────────────────────────────────────────────
11:03:01 AM: 1. Build command from Netlify app
11:03:01 AM: ────────────────────────────────────────────────────────────────
11:03:01 AM: ​
11:03:01 AM: $ hugo
11:03:02 AM: Error: Unable to locate config file or config directory. Perhaps you need to create a new site.
11:03:02 AM: Run hugo help new for details.
11:03:02 AM: Total in 0 ms
11:03:02 AM: ​
11:03:02 AM: ────────────────────────────────────────────────────────────────
11:03:02 AM: “build.command” failed
11:03:02 AM: ────────────────────────────────────────────────────────────────
11:03:02 AM: ​
11:03:02 AM: Error message
11:03:02 AM: Command failed with exit code 255: hugo
11:03:02 AM: ​
11:03:02 AM: Error location
11:03:02 AM: In Build command from Netlify app:
11:03:02 AM: hugo
11:03:02 AM: ​
11:03:02 AM: Resolved config
11:03:02 AM: build:
11:03:02 AM: command: hugo
11:03:02 AM: commandOrigin: ui
11:03:02 AM: publish: /opt/build/repo/public
11:03:02 AM: publishOrigin: ui
11:03:02 AM: Caching artifacts
11:03:02 AM: Started saving build plugins
11:03:02 AM: Finished saving build plugins
11:03:02 AM: Started saving pip cache
11:03:02 AM: Finished saving pip cache
11:03:02 AM: Started saving emacs cask dependencies
11:03:02 AM: Finished saving emacs cask dependencies
11:03:02 AM: Started saving maven dependencies
11:03:02 AM: Finished saving maven dependencies
11:03:02 AM: Started saving boot dependencies
11:03:02 AM: Finished saving boot dependencies
11:03:02 AM: Started saving rust rustup cache
11:03:02 AM: Finished saving rust rustup cache
11:03:02 AM: Started saving go dependencies
11:03:02 AM: Finished saving go dependencies
11:03:04 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
11:03:04 AM: Creating deploy upload records
11:03:04 AM: Failing build: Failed to build site
11:03:04 AM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2
11:03:04 AM: Finished processing build request in 11.957828899s

Hi @leminhhien0301

Appears you are missing a hugo configuration file. Or perhaps it is in the wrong location.

Can you share your git repository?
Can you share a screenshot of your build setting?