首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用blogdown::hugo_install()安装hugo时出错

使用blogdown::hugo_install()安装hugo时出错
EN

Stack Overflow用户
提问于 2020-04-20 07:40:14
回答 1查看 643关注 0票数 0

我无法使用blogdown软件包安装hugo。当我运行blogdown::hugo_install()时,我收到以下消息,并看到一个弹出窗口,其中包含雨果正在下载的消息。弹出窗口出现后,R/ RStudio只是挂起。作为参考,我刚刚更新了R,我的RStudio版本是1.2.5033。我正在运行Windows 10。

代码语言:javascript
复制
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)。当我运行它时,我会得到一个不同的错误:

代码语言:javascript
复制
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)手动安装,但是当我尝试这样做时,我得到了这个错误:

代码语言:javascript
复制
Error: 'install_hugo_bin' is not an exported object from 'namespace:blogdown'

有什么建议吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-04-20 15:22:29

代码语言:javascript
复制
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

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

代码语言:javascript
复制
# 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发布页面上检查它)。

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

函数hugo_install_bin()不是从blogdown导出的。您并不真正需要它(使用install_hugo()代替)。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61317355

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档