From b28cc0b93dbd783a6c3d63708526caf9f89ed8b5 Mon Sep 17 00:00:00 2001 From: RACE Date: Thu, 4 Jan 2024 15:23:44 +0000 Subject: [PATCH] Remove space in .Renviron line and add notes for setting CHROMOTE_CHROME via console --- learning-development/r.qmd | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/learning-development/r.qmd b/learning-development/r.qmd index 6dd6b03..ec317ce 100644 --- a/learning-development/r.qmd +++ b/learning-development/r.qmd @@ -654,9 +654,13 @@ If when using shinytest2, you get the following error, then you'll need to set a `Error in initialize(...) : Invalid path to Chrome` +First step to resolve this is to set the path to chrome.exe (the Chrome application file itself where you've installed it) via the console for the current session. Set the `CHROMOTE_CHROME` environment variable to the path to the chrome.exe file on your computer. As an example it should look something like this: + +`Sys.setenv(CHROMOTE_CHROME = "C:/Users/jbloggs/AppData/Local/Google/Chrome/Application/chrome.exe")` + To set the environment variable, you'll need to edit your .Renviron file. This will fix the error across all R projects. If you don't know where to find the .Renviron file, you can use the `usethis` package to open it in R-Studio using `usethis::edit_r_environ()`. Then set the `CHROMOTE_CHROME` environment variable to the path to `chrome.exe` on your computer. As an example it should look something like this: -`CHROMOTE_CHROME = "C:/Users/jbloggs/AppData/Local/Google/Chrome/Application/chrome.exe"` +`CHROMOTE_CHROME="C:/Users/jbloggs/AppData/Local/Google/Chrome/Application/chrome.exe"` Note: remember to give the path using forward-slashes rather than back-slashes.