Doug Johnson
Doug Johnson

Reputation: 25

Error installing hugo using blogdown::hugo_install()

I am unable to install hugo using the blogdown package. When I run blogdown::hugo_install() I get the following message and see a pop-up window with a message that hugo is downloading. After the pop-up window appears, R / RStudio just hangs though. For reference, I have just updated R and my RStudio version is 1.2.5033. I am running Windows 10.

The latest Hugo version is 0.69.0 trying URL 'https://github.com/gohugoio/hugo/releases/download/v0.69.0/hugo_extended_0.69.0_Windows-64bit.zipContent length 649 bytes

I also tried running blogdown:hugo_install(version = 0.69) . When I run that, I get a different error:

trying URL 'https://github.com/gohugoio/hugo/releases/download/v0.69/hugo_extended_0.69_Windows-64bit.zip'
trying URL 'https://github.com/gohugoio/hugo/releases/download/v0.69/hugo_extended_0.69_Windows-64bit.zip'
trying URL 'https://github.com/gohugoio/hugo/releases/download/v0.69/hugo_extended_0.69_Windows-64bit.zip'
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100     9  100     9    0     0      9      0  0:00:01 --:--:--  0:00:01    44
Error in install_hugo_bin(exec) : 
  Unable to install Hugo to any of these dirs: C:\Users\dougj\AppData\Roaming/Hugo, 
In addition: Warning messages:
1: In download.file(url, output, ..., method = method) :
  cannot open URL 'https://github.com/gohugoio/hugo/releases/download/v0.69/hugo_extended_0.69_Windows-64bit.zip': HTTP status was '404 Not Found'
2: In download.file(url, output, ..., method = method) :
  cannot open URL 'https://github.com/gohugoio/hugo/releases/download/v0.69/hugo_extended_0.69_Windows-64bit.zip': HTTP status was '404 Not Found'
3: In download.file(url, output, ..., method = method) :
  cannot open URL 'https://github.com/gohugoio/hugo/releases/download/v0.69/hugo_extended_0.69_Windows-64bit.zip': HTTP status was '404 Not Found'
4: In utils::unzip(zipfile) : error 1 in extracting from zip file
5: In file.copy(exec, destdir, overwrite = TRUE) :
  problem copying .\hugo.exe to C:\Users\dougj\AppData\Roaming\Hugo\hugo.exe: No such file or directory

Lastly, I tried installing the dev version of blogdown, downloading the hugo binary, and then manually installing using blogdown::hugo_install_bin(path_to_unzipped_binary.exe) but I get this error when I try that:

Error: 'install_hugo_bin' is not an exported object from 'namespace:blogdown'

Any suggestions?

Upvotes: 0

Views: 932

Answers (1)

Yihui Xie
Yihui Xie

Reputation: 30114

The latest Hugo version is 0.69.0
trying URL 'https://github.com/gohugoio/hugo/releases/download/v0.69.0/hugo_extended_0.69.0_Windows-64bit.zip'
Content length 649 bytes

According to the message above, the content length doesn't seem to be correct (should be about 13Mb). I don't know why, but you might be behind a firewall. If that's the case, you could download this zip file in your web browser, and pass the local file path of the zip file to blogdown::install_hugo(), e.g.,

# change the path below to the actual path of the zip file on your computer
blogdown::install_hugo('~/Downloads/hugo_extended_0.69.0_Windows-64bit.zip')

For the rest of your issues:

I also tried running blogdown:hugo_install(version = 0.69) . When I run that, I get a different error

That is because there is no version 0.69. There is only 0.69.0 (you can check it on the Github releases page).

Lastly, I tried installing the dev version of blogdown, downloading the hugo binary, and then manually installing using blogdown::hugo_install_bin(path_to_unzipped_binary.exe)

The function hugo_install_bin() is not exported from blogdown. You don't really need it (use install_hugo() instead).

Upvotes: 3

Related Questions