Home
Support Forums

"build.command" failed - Command failed with exit code 255: hugo - v0.87.0

PLEASE help us help you by writing a good post!

Hi!
My netlify site name is Maria Calderó Pascual - Netlify App
I am trying to build my first hugo website but I keep failing under the following error (copied below).
My current build site is
happy-hermann-366b32.netlify.app
But have tried to start from zero in previous sites.

I have tried different options suggested in other posts without any luck.
Thanks for your support!

I have been following this guy tutorials: RStudio to Github to Netlify Live Site blogdown Hugo - YouTube

Here is the copied-paste deployment failure:
11:02:15 AM: Build ready to start
11:02:20 AM: build-image version: fa439ad1ab9393b2c0d449d8d7c033927683f4b0
11:02:20 AM: build-image tag: v4.3.0
11:02:20 AM: buildbot version: e99637385725adf30662bad8cf7d70d9f3623653
11:02:20 AM: Fetching cached dependencies
11:02:20 AM: Failed to fetch cache, continuing with build
11:02:20 AM: Starting to prepare the repo for build
11:02:20 AM: No cached dependencies found. Cloning fresh repo
11:02:20 AM: git clone https://github.com/calderom/mcpwebsite
11:02:21 AM: Preparing Git Reference refs/heads/main
11:02:22 AM: Parsing package.json dependencies
11:02:22 AM: Starting build script
11:02:22 AM: Installing dependencies
11:02:22 AM: Python version set to 2.7
11:02:23 AM: Downloading and installing node v16.9.1…
11:02:23 AM: Downloading https://nodejs.org/dist/v16.9.1/node-v16.9.1-linux-x64.tar.xz
11:02:23 AM: Computing checksum with sha256sum
11:02:24 AM: Checksums matched!
11:02:26 AM: Now using node v16.9.1 (npm v7.21.1)
11:02:27 AM: Started restoring cached build plugins
11:02:27 AM: Finished restoring cached build plugins
11:02:27 AM: Attempting ruby version 2.7.2, read from environment
11:02:28 AM: Using ruby version 2.7.2
11:02:28 AM: Using PHP version 8.0
11:02:28 AM: Installing Hugo 0.87.0
11:02:29 AM: hugo v0.87.0-B0C541E4+extended linux/amd64 BuildDate=2021-08-03T10:57:28Z VendorInfo=gohugoio
11:02:29 AM: Started restoring cached go cache
11:02:29 AM: Finished restoring cached go cache
11:02:29 AM: go version go1.16.5 linux/amd64
11:02:29 AM: go version go1.16.5 linux/amd64
11:02:29 AM: Installing missing commands
11:02:29 AM: Verify run directory
11:02:31 AM: ​
11:02:31 AM: ────────────────────────────────────────────────────────────────
11:02:31 AM: Netlify Build
11:02:31 AM: ────────────────────────────────────────────────────────────────
11:02:31 AM: ​
11:02:31 AM: ❯ Version
11:02:31 AM: @netlify/build 18.10.0
11:02:31 AM: ​
11:02:31 AM: ❯ Flags
11:02:31 AM: baseRelDir: true
11:02:31 AM: buildId: 614308170bbc84cc641a7ff7
11:02:31 AM: deployId: 614308170bbc84cc641a7ff9
11:02:31 AM: ​
11:02:31 AM: ❯ Current directory
11:02:31 AM: /opt/build/repo
11:02:31 AM: ​
11:02:31 AM: ❯ Config file
11:02:31 AM: No config file was defined: using default values.
11:02:31 AM: ​
11:02:31 AM: ❯ Context
11:02:31 AM: production
11:02:31 AM: ​
11:02:31 AM: ────────────────────────────────────────────────────────────────
11:02:31 AM: 1. Build command from Netlify app
11:02:31 AM: ────────────────────────────────────────────────────────────────
11:02:31 AM: ​
11:02:31 AM: $ hugo
11:02:31 AM: Error: Unable to locate config file or config directory. Perhaps you need to create a new site.
11:02:31 AM: Run hugo help new for details.
11:02:31 AM: Total in 0 ms
11:02:31 AM: ​
11:02:31 AM: ────────────────────────────────────────────────────────────────
11:02:31 AM: “build.command” failed
11:02:31 AM: ────────────────────────────────────────────────────────────────
11:02:31 AM: ​
11:02:31 AM: Error message
11:02:31 AM: Command failed with exit code 255: hugo
11:02:31 AM: ​
11:02:31 AM: Error location
11:02:31 AM: In Build command from Netlify app:
11:02:31 AM: hugo
11:02:31 AM: ​
11:02:31 AM: Resolved config
11:02:31 AM: build:
11:02:31 AM: command: hugo
11:02:31 AM: commandOrigin: ui
11:02:31 AM: environment:
11:02:31 AM: - HUGO_VERSION
11:02:31 AM: publish: /opt/build/repo/public
11:02:31 AM: publishOrigin: ui
11:02:31 AM: headers:
11:02:31 AM: - for: /*
values:
Permissions-Policy: accelerometer=(), camera=(), geolocation=(), gyroscope=(), magnetometer=(), microphone=(), payment=(), usb=()
Referrer-Policy: strict-origin-when-cross-origin
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
- for: /index.webmanifest
values:
Content-Type: application/manifest+json
- for: /index.xml
values:
Content-Type: application/rss+xml
Caching artifacts
11:02:31 AM: Started saving build plugins
11:02:31 AM: Finished saving build plugins
11:02:31 AM: Started saving pip cache
11:02:31 AM: Finished saving pip cache
11:02:31 AM: Started saving emacs cask dependencies
11:02:31 AM: Finished saving emacs cask dependencies
11:02:31 AM: Started saving maven dependencies
11:02:31 AM: Finished saving maven dependencies
11:02:31 AM: Started saving boot dependencies
11:02:31 AM: Finished saving boot dependencies
11:02:31 AM: Started saving rust rustup cache
11:02:31 AM: Finished saving rust rustup cache
11:02:31 AM: Started saving go dependencies
11:02:31 AM: Finished saving go dependencies
11:02:34 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
11:02:34 AM: Creating deploy upload records
11:02:34 AM: Failing build: Failed to build site
11:02:34 AM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2
11:02:34 AM: Finished processing build request in 13.952621586s

The config.toml file seems to be missing.

There’s no such file in your repo:

Hugo needs that file to build your website.