Warning message for V8 package - "This system has a very old version of libv8"?

I am trying to use the rmapshaper package and having an issue which I think might possibly be related to the warning message I get from library(V8) : “Warning: this system has a very old version of libv8. Some packages may not work”.

I keep getting the error “SyntaxError: Unexpected token function” when using the ms_simplify() function. I get this error even when I just copy and paste the exact example given in the documentation: (ms_simplify function - RDocumentation)

ms_simplify(poly_sf, keep=0.5)
Error: SyntaxError: Unexpected token function

When I load rmapshaper I also get the following warning message:
Warning: v8 Engine is version but version >=6 is required for full functionality. Some rmapshaper functions, notably ms_clip() and ms_erase(), may not work. See GitHub - jeroen/V8: Embedded JavaScript Engine for R for help installing a modern version of v8 on your operating system.

I did go to the link, but I didn’t understand how to install a newer version of the v8 engine , only the package… Sorry I really don’t understand anything about V8. I did make sure I had the most up to date version of the V8 package, but that didn’t change any warning or error messages.

If anyone has any ideas, I’d be very grateful!