Hugo Command Not Found during first Build

Howdy. Looking to move to Cloudflare from Amplify. The build works just fine locally and in Amplify. The problem appears to be Cloudflare specific. My google-fu has failed me as I cannot find the error reported

During the build, I am running into a “Hugo command Not found” problem. The only ENV variables used set the Hugo and Node versions. Changing the Hugo version (can’t use the default due to a need for WebP support) does not alleviate the error.

11:17:03.429 NPM modules installed using Yarn
11:17:03.648 Installing Hugo 0.91.2
11:17:04.784 hugo v0.91.2-1798BD3F+extended linux/amd64 BuildDate=2021-12-23T15:33:34Z VendorInfo=gohugoio
11:17:04.787 Started restoring cached go cache
11:17:04.790 Finished restoring cached go cache
11:17:04.820 go version go1.14.4 linux/amd64
11:17:04.832 go version go1.14.4 linux/amd64
11:17:04.834 Installing missing commands
11:17:04.834 Verify run directory
11:17:04.834 Executing user command: Hugo
11:17:04.834 /opt/build/bin/build: line 39: Hugo: command not found
11:17:04.838 Failed: build command exited with code: 127

Is hugo installed using apt or build from source?
Furthermore, you might be missing it via PATH variable?
Maybe you need to add the ./ before hugo?
Which hugo version are you running?

I have no idea how Hugo is installed. This is Cloudflare’s internal build process installing it. I would assume Cloudflare would have addressed the path.

The version of hugo is shown in the error code. I can only use 0.89+, and changing the version does not change the fact that Cloudflare’s internal build process does not correct the PATH.

Problem solved. My browser capitalized the build command Hugo when I typed hugo. Fixing the capitalization worked.


1 Like