Skip to content

Commit

Permalink
Remove space in .Renviron line and add notes for setting CHROMOTE_CHR…
Browse files Browse the repository at this point in the history
…OME via console
  • Loading branch information
cjrace committed Jan 4, 2024
1 parent f45e2b7 commit b28cc0b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion learning-development/r.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit b28cc0b

Please sign in to comment.