【问题标题】:Error installing hugo using blogdown::hugo_install()使用 blogdown::hugo_install() 安装 hugo 时出错
【发布时间】:2020-04-20 07:40:14
【问题描述】:

我无法使用 blogdown 包安装 hugo。当我运行 blogdown::hugo_install() 时,我收到以下消息,并看到一个弹出窗口,其中显示了 hugo 正在下载的消息。弹出窗口出现后,R / RStudio 只是挂起。作为参考,我刚刚更新了 R,我的 RStudio 版本是 1.2.5033。我正在运行 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

我还尝试运行 blogdown:hugo_install(version = 0.69) 。当我运行它时,我得到一个不同的错误:

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

最后,我尝试安装 blogdown 的 dev 版本,下载 hugo 二进制文件,然后使用 blogdown::hugo_install_bin(path_to_unzipped_binary.exe) 手动安装,但尝试时出现此错误:

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

有什么建议吗?

【问题讨论】:

    标签: r blogdown


    【解决方案1】:
    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
    

    根据上面的消息,内容长度似乎不正确(should be about 13Mb)。我不知道为什么,但你可能在防火墙后面。如果是这种情况,您可以在网络浏览器中下载此 zip 文件,并将 zip 文件的本地文件路径传递给 blogdown::install_hugo(),例如,

    # 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')
    

    对于您的其他问题:

    我还尝试运行 blogdown:hugo_install(version = 0.69) 。当我运行它时,我得到一个不同的错误

    那是因为没有 0.69 版本。只有0.69.0(你可以在Github releases page查看)。

    最后,我尝试安装开发版的 blogdown,下载了 hugo 二进制文件,然后使用 blogdown::hugo_install_bin(path_to_unzipped_binary.exe) 手动安装

    函数hugo_install_bin() 没有从blogdown 导出。你真的不需要它(改用install_hugo())。

    【讨论】:

    • 非常感谢!这实际上是一个防火墙问题。我已经安装了诺顿。当我暂时关闭它时,一切正常。
    猜你喜欢
    • 2021-03-05
    • 2019-05-03
    • 1970-01-01
    • 2020-08-16
    • 1970-01-01
    • 2019-10-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多