Error kniting r code after installed R studio

Hi! I installed the R Studio on my new MacBook and tried to do my Stats homework with R code. After completing R code assignment, I wanted to knit it to HTML. However, the error keeps showing no matter what I do. I tried to reinstall R studio and even knit it on my friend's computer. Nothing worked. Here's the error code. Please help me look into it. Thank you!

sh: /Applications/ Bad CPU type in executable Error in strsplit(info, "\n", useBytes = TRUE)[[1]] : subscript out of bounds Calls: ... pandoc_available -> find_pandoc -> lapply -> FUN -> get_pandoc_version In addition: Warning message: In system(paste(shQuote(path), "--version"), intern = TRUE) : running command ''/Applications/' --version' had status 126 Execution halted

A search with the above string and 'pandoc' gave me (among others) the following link to a closed issue The pandoc built in with latest Rstudio is incompatible with MAC OS: 13.1 Macbook Air M2 .

Maybe this helps you?

Thank you so much and sorry for the late reply. I tried the code they suggested : Users/sbin/softwareupdate --install-rosetta --agree-to-license, but it shows: 'Error: object'Users' not found. I'm pretty sure my user name is Users, or am I wrong? "attached the image"