V8 path error when trying to run DAG using ggdag package

I am trying to code Directed Acyclic Graphs (DAGs) in Rstudio but keep getting the following error message:
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/V8/libs/V8.so':
dlopen(/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/V8/libs/V8.so, 0x0006): symbol not found in flat namespace '__ZNSt3__122__libcpp_verbose_abortEPKcz'

I am using the ggdag and tidyverse packages and have a mac. I have used Rstudio for over a year on my Mac and had no problems; however I completely deleted R, Rstudio, and any pertaining framework files on my computer and redownloaded them, yet the issue persists. I tried to download the V8 package in my computer terminal and link the path on Rstudio (using guidance from Chat GPT) but haven't had any luck so far.

Here is the first chunk of code where the error occurs:

# libraries
library(ggdag)
library(tidyverse)

#### fork

# code the fork structure
fork = dagify(
  Y ~ X + Z,
  X ~ Z,
  exposure = "X",
  outcome = "Y",
  coords = list(
    x = c(X = 0, Z = 0, Y = 1), # horizontal
    y = c(X=0, Z= 1, Y=0) # vertical
  )
)

This means that you have a broken installation for the V8 package. Try to reinstall it.

Replying in case any Mac users run into similar problems with the V8 package! The new Sequoia macOS upgrade updated the V8 engine and Xcode toolchain automatically. It did also require that I reinstall Rstudio after the update, but I was able to run the DAG properly using the ggdag package.

For the record, this has nothing to do with RStudio, so no need to reinstall RStudio if you see this.

You probably do need to reinstall the V8 package, possibly compiled from source.