I think just install the appropriate package here:
deb: libv8-dev or libnode-dev (Debian / Ubuntu)
rpm: v8-devel (Fedora, EPEL)
brew: v8 (OSX)
csw: libv8_dev (Solaris)
A question like this came up the other day and this seemed to work out there (Rstan no longer working)
If you just need to run Stan models, you might try https://mc-stan.org/cmdstanr/ (it’s probably easier to install)