I used RStudio, blogdown and Hugo. All of them were latest version.
Frist, I downloaded blogdown package in RStudio. And started it with:
No error generated.
Second, I tried command:
blogdown::new_site(theme = 'yihui/hugo-ivy')
Still, no error generated.
(After the error occurred, I tried a different theme when I retested it.)
blogdown::new_site(theme = 'lxndrblz/anatole')
However, in console, it showed:
Want to serve and preview the site now? (y/n)
I typed "y". Then here came the error:
Error: Failed to run the command in the background: "C:/Users/xxxx/AppData/Roaming/Hugo/0.118.2/hugo.exe"
I tried redownloading hugo package and add the directory ("C:/Users/xxxx/AppData/Roaming/Hugo/0.118.2/hugo.exe") to the PATH environment variable as Hugo's doc says.
And I tried reinstalling all the tools, such as Git, Go, R, RStudio and Hugo. All of them were latest version.
And I tried open RStudio as an administrator...
The problem is still unresolved...