Error generating pdf with knitr after installing phantomjs ()

When running knitr / knitr to pdf, after installing the webshot package and then from the RStudio console webshot :: install_phantomjs (), the following error occurs when trying to generate a .pdf output

But I don't know how to solve it.

I have installed it because when generating the output with knitr to pdf an error text was being printed in the .pdf like this: PhantomJS not found. You can install it with webshot :: install_phantomjs (). If it is installed, please make sure the phantomjs executable can be found via the PATH variable.


Error: <c_error in rethrow_call(c_processx_exec, command, c(command, args), pty,  ...:
 create process 'C:\Users\JoséCarlos\AppData\Roaming/PhantomJS/phantomjs.exe' (system error 267, El nombre del directorio no es válido.

) @win/processx.c:1040 (processx_exec)>

 Stack trace:

 1. rmarkdown::render("esfuerzo local social EELL.rmd", "pdf_document")
 2. knitr::knit(knit_input, knit_output, envir = envir, quiet = quiet)
 3. knitr:::process_file(text, output)
 4. base:::withCallingHandlers(if (tangle) process_tangle(group) else process_g ...
 5. knitr:::process_group(group)
 6. knitr:::process_group.block(group)
 7. knitr:::call_block(x)
 8. knitr:::block_exec(params)
 9. knitr:::eng_r(options)
 10. knitr:::in_dir(input_dir(), evaluate(code, envir = env, new_device = FALSE, ...
 11. knitr:::evaluate(code, envir = env, new_device = FALSE, keep_warning = !isF ...
 12. evaluate::evaluate(...)
 13. evaluate:::evaluate_call(expr, parsed$src[[i]], envir = envir,  ...
 14. base:::handle(pv <- withCallingHandlers(withVisible(value_fun(ev$value,  ...
 15. base:::withCallingHandlers(withVisible(value_fun(ev$value, ev$visible)),  ...
 16. base:::withVisible(value_fun(ev$value, ev$visible))
 17. knitr:::value_fun(ev$value, ev$visible)
 18. knitr:::fun(x, options = options)
 19. base:::withVisible(knit_print(x, ...))
 20. knitr:::knit_print(x, ...)
 21. knitr:::html_screenshot(x)
 22. knitr:::in_dir(d, { ...
 23. base:::do.call(getFromNamespace("webshot", webshot), c(list(f1,  ...
 24. (function (url = NULL, file = "webshot.png", vwidth = 992, vheight = 744,  ...
 25. webshot:::phantom_run(args)
 26. callr::process$new(phantom_bin, args = args, stdout = "|", stderr = "|",  ...
 27. processx:::initialize(...)
 28. processx:::process_initialize(self, private, command, args, stdin,  ...
 29. rethrow_call(c_processx_exec, command, c(command, args), pty,  ...

 x create process 'C:\Users\JoséCarlos\AppData\Roaming/PhantomJS/phantomjs.exe' (system error 267, El nombre del directorio no es válido.

) @win/processx.c:1040 (processx_exec)

I need your help. In any case, the .rmd document includes charts generated with highcharts that I need to incorporate into the report. If it weren't possible with webshot and phantomjs, what would be the alternative?