One option is the webshot
package. Here's "An Introduction to the webshot
Package" by Winston Chang
The section "Save wordcloud2 as ...." in the R Graph Gallery lists the following code to save a wordcloud
https://www.r-graph-gallery.com/196-the-wordcloud2-library/
#install webshot
library(webshot)
webshot::install_phantomjs()
# Make the graph
my_graph=wordcloud2(demoFreq, size=1.5)
# save it in html
library("htmlwidgets")
saveWidget(my_graph,"tmp.html",selfcontained = F)
# and in png
webshot("tmp.html","fig_1.png", delay =5, vwidth = 480, vheight=480) # changed to png.