Hi! I’m trying to deploy this repo where I have a hugo blog: GitHub - RinkiyaKeDad/my-fav-quotes
But during the building phase it fails giving the following message:
9:02:49 PM: Netlify Build
9:02:49 PM: ────────────────────────────────────────────────────────────────
9:02:49 PM:
9:02:49 PM: ❯ Version
9:02:49 PM: @netlify/build 29.23.5
9:02:49 PM:
9:02:49 PM: ❯ Flags
9:02:49 PM: baseRelDir: true
9:02:49 PM: buildId: 653a8697a6092d10f9731a9b
9:02:49 PM: deployId: 653a8697a6092d10f9731a9d
9:02:49 PM:
9:02:49 PM: ❯ Current directory
9:02:49 PM: /opt/build/repo
9:02:49 PM:
9:02:49 PM: ❯ Config file
9:02:49 PM: /opt/build/repo/netlify.toml
9:02:49 PM:
9:02:49 PM: ❯ Context
9:02:49 PM: production
9:02:49 PM:
9:02:49 PM: build.command from netlify.toml
9:02:49 PM: ────────────────────────────────────────────────────────────────
9:02:49 PM:
9:02:49 PM: $ hugo
9:02:49 PM: Error: Unable to locate config file or config directory. Perhaps you need to create a new site.
9:02:49 PM: Run `hugo help new` for details.
9:02:49 PM: Total in 0 ms
9:02:49 PM:
9:02:49 PM: "build.command" failed
9:02:49 PM: ────────────────────────────────────────────────────────────────
9:02:49 PM:
9:02:49 PM: Error message
9:02:49 PM: Command failed with exit code 255: hugo (https://ntl.fyi/exit-code-255)
9:02:49 PM:
9:02:49 PM: Error location
9:02:49 PM: In build.command from netlify.toml:
9:02:49 PM: hugo
9:02:49 PM:
9:02:49 PM: Resolved config
9:02:49 PM: build:
9:02:49 PM: command: hugo
9:02:49 PM: commandOrigin: config
9:02:49 PM: publish: /opt/build/repo/public
9:02:49 PM: publishOrigin: config
9:02:50 PM: Failed during stage "building site": Build script returned non-zero exit code: 2
9:02:50 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
9:02:50 PM: Failing build: Failed to build site
9:02:50 PM: Finished processing build request in 9.994s
Most solutions I read online talked about configuring the right path to run the build from. I am running it from the root of my repo which is where my Hugo code is. When I able to clone the repo, I am able to run hugo
from the root and get access to the built site in the /public
folder so I’m really confused as to what is going wrong. This is my netlify.toml
:
[build]
command = "hugo"
publish = "public"
And my deploy build settings:
Would appreciate any help or pointers to what I might be doing incorrectly!