R blogdown new_site() 抛出错误

R blogdown new_site() throws error

如果我尝试 运行 blogdown::new_site() 我收到一条错误消息,我怀疑可能是 linux/windows 斜杠的转换问题?

blogdown::new_site()
Congratulations! Your new Hugo site is created in D:\Documents\Blog.

Just a few more steps and you're ready to go:

1. Download a theme into the same-named folder.
   Choose a theme from https://themes.gohugo.io/, or
   create your own with the "hugo new theme <THEMENAME>" command.
2. Perhaps you want to add some content. You can add single files
   with "hugo new <SECTIONNAME>\<FILENAME>.<FORMAT>".
3. Start the built-in live server via "hugo server".

Visit https://gohugo.io/ for quickstart guide and full documentation.
trying URL 'https://github.com/yihui/hugo-lithium-theme/archive/master.zip'
Content length 119078 bytes (116 KB)
downloaded 116 KB

Error in gsub(tmpdir, ".", zipdir) : 
  invalid regular expression '.aec55bc496d', reason 'Invalid back reference'

不太明白那里发生了什么......我在一个空目录上命令并通过 Rstudio 绑定它也尝试了不同的模板 gcushen/hugo-academic 导致了同样的错误消息......

我在 windows 机器上 运行ning R,我相信所有软件包都是最新的...

sessionInfo()
R version 3.4.3 (2017-11-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=English_United Kingdom.1252  LC_CTYPE=English_United Kingdom.1252   
[3] LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C                           
[5] LC_TIME=English_United Kingdom.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] blogdown_0.5.9

loaded via a namespace (and not attached):
[1] compiler_3.4.3 bookdown_0.7   tools_3.4.3    yaml_2.1.18    knitr_1.20     xfun_0.1   

正如我在评论中提到的,这确实是 blogdown 中的一个错误,可以追溯到 Windows 和 Unix 如何处理路径名中的斜杠的差异(或者更具体地说,tempfile()utils::unzip() 在 Windows) 的输出中处理斜线。

从 blogdown 的 0.5.10 版开始,这个问题应该已经解决了,您可以使用 devtools::install_github("rstudio/blogdown").

安装它