How do I change the version of HUGO used to build my site?

I’m building a site based on this forestry template. Here is on my github account
I builds correctly on
You should be able to see the unpublished site on this url.

The console says the site is correctly published.

A nice guy from forestry opened an issue here, discovering the problem of the missing netlify build maybe caused by the version of HUGO used.

I’m n00b, where shall I change it? Can’t find any option in my deploy menu. .

Hi, @vongomben, there is a way! There is documentation about this here:

To summarize, set the HUGO_VERSION environment variable here:

(You can also set that environment variable in netlify.toml if you prefer.)

If changing the Hugo version doesn’t resolve this, please reply anytime and we will keep troubleshooting

Hi Luke.
Thanks for the reply.
I’ve setted the environmental variable to 0.68 and later to 0.71 (the one that forestry build).

Neither of the two are working.

Any more help?

Hey there, that link is to theme.toml. You’ll need to add the version that our build uses in the environment table that Luke linked to or in to netlify.toml. Hope this helps!

yes I’ve done it.
I’ve added the variable in the deploy tab as explained.
I’ve put the link as reference on the version used from the theme’s author.

BTW which version of HUGO does Netlify uses as default?

Anyway, still not working :frowning:

Heya! Our build image includes:

    • 0.54 extended (default)
    • Any version installable via binrc

Can you show me a deploy log where you’re trying to build a site with the version you’re specifying?

I am seeing the following error in my build logs regarding the version of hugo. I don’t set the version of hugo. I will try setting it and see if that helps but why doesn’t Netlify just use the latest version as a default so I don’t get these errors?

11:05:38 AM: $ hugo

11:05:40 AM: ERROR 2020/08/13 15:05:40 GHOSTWRITER theme does not support Hugo version 0.54.0. Minimum version required is 0.60

11:05:40 AM: Building sites … Total in 368 ms

11:05:40 AM: Error: Error building site: logged 1 error(s)

Please see below. I tried using HUGO 0.68, but there is no binary for that. What version of Hugo does Netlify have a binary for?

11:28:16 AM: Installing Hugo 0.68

11:28:17 AM: Error during Hugo 0.68 install: error downloading project gohugoio/hugo, from - binary doesn’t seem to exist: 404

11:28:17 AM: Error running command: Build script returned non-zero exit code: 1

11:28:17 AM: Failing build: Failed to build site

11:28:17 AM: Failed during stage ‘building site’: Build script returned non-zero exit code: 1

Okay, I had to use 0.74.3 instead of just 0.74. Solved now. Thanks! I still with Netlify would just use the latest version of Hugo instead of making me set it. I see Netlify also uses Python 2.7. I thought most things had switched to Python 3 by now.

Hey @rogerjbos,

Good job on self-solving and feeding back to us! As for Python 3, check this out! :slight_smile: