Build failed with Hugo -d command

1:50:12 PM: Build ready to start
1:50:14 PM: build-image version: 0e2f4c52031ab562db66aec633308326e3b108d0 (focal)
1:50:14 PM: build-image tag: focal
1:50:14 PM: buildbot version: 7b804ef49dc9bfd8ae6e08b25d297f8eb94d3bc5
1:50:14 PM: Fetching cached dependencies
1:50:14 PM: Failed to fetch cache, continuing with build
1:50:14 PM: Starting to prepare the repo for build
1:50:14 PM: No cached dependencies found. Cloning fresh repo
1:50:14 PM: git clone https://github.com/exist2021/articulation
1:50:16 PM: Preparing Git Reference refs/heads/master
1:50:16 PM: Parsing package.json dependencies
1:50:17 PM: Starting build script
1:50:17 PM: Installing dependencies
1:50:17 PM: Python version set to 2.7
1:50:18 PM: Downloading and installing node v16.16.0…
1:50:18 PM: Downloading https://nodejs.org/dist/v16.16.0/node-v16.16.0-linux-x64.tar.xz…
1:50:18 PM: Computing checksum with sha256sum
1:50:18 PM: Checksums matched!
1:50:21 PM: Now using node v16.16.0 (npm v8.11.0)
1:50:21 PM: Started restoring cached build plugins
1:50:21 PM: Finished restoring cached build plugins
1:50:21 PM: Attempting ruby version 2.7.2, read from environment
1:50:22 PM: Using ruby version 2.7.2
1:50:22 PM: Using PHP version 8.0
1:50:22 PM: Started restoring cached go cache
1:50:22 PM: Finished restoring cached go cache
1:50:22 PM: Installing Go version 1.17 (requested 1.17)
1:50:28 PM: unset GOOS;
1:50:28 PM: unset GOARCH;
1:50:28 PM: export GOROOT=β€˜/opt/buildhome/.gimme/versions/go1.17.linux.amd64’;
1:50:28 PM: export PATH=β€œ/opt/buildhome/.gimme/versions/go1.17.linux.amd64/bin:${PATH}”;
1:50:28 PM: go version >&2;
1:50:28 PM: export GIMME_ENV=β€œ/opt/buildhome/.gimme/env/go1.17.linux.amd64.env”
1:50:28 PM: go version go1.17 linux/amd64
1:50:28 PM: Installing missing commands
1:50:28 PM: Verify run directory
1:50:29 PM: ​
1:50:29 PM: ────────────────────────────────────────────────────────────────
1:50:29 PM: Netlify Build
1:50:29 PM: ────────────────────────────────────────────────────────────────
1:50:29 PM: ​
1:50:29 PM: ❯ Version
1:50:29 PM: @netlify/build 27.3.4
1:50:29 PM: ​
1:50:29 PM: ❯ Flags
1:50:29 PM: baseRelDir: true
1:50:29 PM: buildId: 62d1233c1a144071c7dfe4ed
1:50:29 PM: deployId: 62d1233c1a144071c7dfe4ef
1:50:29 PM: ​
1:50:29 PM: ❯ Current directory
1:50:29 PM: /opt/build/repo
1:50:29 PM: ​
1:50:29 PM: ❯ Config file
1:50:29 PM: No config file was defined: using default values.
1:50:29 PM: ​
1:50:29 PM: ❯ Context
1:50:29 PM: production
1:50:29 PM: ​
1:50:29 PM: ────────────────────────────────────────────────────────────────
1:50:29 PM: 1. Build command from Netlify app
1:50:29 PM: ────────────────────────────────────────────────────────────────
1:50:29 PM: ​
1:50:29 PM: $ Hugo -d
1:50:29 PM: bash: Hugo: command not found
1:50:29 PM: ​
1:50:29 PM: ────────────────────────────────────────────────────────────────
1:50:29 PM: β€œbuild.command” failed
1:50:29 PM: ────────────────────────────────────────────────────────────────
1:50:29 PM: ​
1:50:29 PM: Error message
1:50:29 PM: Command failed with exit code 127: Hugo -d (Search results for '"non-zero exit code: 127"' - Netlify Support Forums)
1:50:29 PM: ​
1:50:29 PM: Error location
1:50:29 PM: In Build command from Netlify app:
1:50:29 PM: Hugo -d
1:50:29 PM: ​
1:50:29 PM: Resolved config
1:50:29 PM: build:
1:50:29 PM: command: Hugo -d
1:50:29 PM: commandOrigin: ui
1:50:29 PM: publish: /opt/build/repo/_site
1:50:29 PM: publishOrigin: ui
1:50:29 PM: Caching artifacts
1:50:29 PM: Started saving build plugins
1:50:29 PM: Finished saving build plugins
1:50:29 PM: Started saving pip cache
1:50:29 PM: Finished saving pip cache
1:50:29 PM: Started saving emacs cask dependencies
1:50:29 PM: Finished saving emacs cask dependencies
1:50:29 PM: Started saving maven dependencies
1:50:29 PM: Finished saving maven dependencies
1:50:29 PM: Started saving boot dependencies
1:50:29 PM: Finished saving boot dependencies
1:50:29 PM: Started saving rust rustup cache
1:50:29 PM: Finished saving rust rustup cache
1:50:29 PM: Started saving go dependencies
1:50:29 PM: Finished saving go dependencies
1:50:31 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
1:50:31 PM: Creating deploy upload records
1:50:31 PM: Failing build: Failed to build site
1:50:31 PM: Failed during stage β€˜building site’: Build script returned non-zero exit code: 2 (Search results for '"non-zero exit code: 2"' - Netlify Support Forums)
1:50:31 PM: Finished processing build request in 17.112432164s

Instead of Hugo, try hugo (note the lowercase)

Thanks for sharing that, @Roneo.org :raised_hands:. @exist2021, if you are still encountering errors after trying Roneo’s suggestion, please share a link to your site, your build settings, and the additional debugging steps you have taken.

Thanks!

1 Like