Hi,
I was trying to install TinyTex this morning via tinytex::install_tinytex and ran into a weird error. I got the same error from both the current CRAN release (0.7) and the current devel version. Here is the error:
> tinytex::install_tinytex()
trying URL 'http://mirror.ctan.org/systems/texlive/tlnet/install-tl.zip'
Content length 349 bytes
downloaded 18.9 MB
trying URL 'https://github.com/yihui/tinytex/raw/master/tools/pkgs-custom.txt'
Content length 142 bytes
downloaded 275 bytes
trying URL 'https://github.com/yihui/tinytex/raw/master/tools/texlive.profile'
Content length 142 bytes
downloaded 295 bytes
Starting to install TinyTeX to C:\Users\Tyler.Bradley\AppData\Roaming/TinyTeX. It will take a few minutes.
Error in paste0("Next you may see two error dialog boxes about the missing luatex.dll, ", :
argument is missing, with no default
Please restart your R session and IDE (if you are using one, such as RStudio or Emacs) and check if tinytex:::is_tinytex() is TRUE.
As expected, given the error message, when I restarted my R and Rstudio session tinytex:::is_tinytex() returned FALSE. I looked through the source code and it looks like the issue is here. I am not entirely sure what is causing the issue, since I don't see any issues with the paste0 call. However, this was the only thing stopping the installing. I ran debug(tinytex::install_tinytex()) and ran everything but those few lines and it looks like TinyTex installed properly. After restarting my session, tinytex:::is_tinytex returned TRUE.
I thought it was worthwhile to report this, as I am not sure whether other people have run into this before.
Thanks for the great packages!
As a follow up, once I tried to knit a document after installing TinyTex, I get the following error:
Error: Failed to compile low-dbps-q2-2018-report.tex.
In addition: Warning message:
In system2(..., stdout = FALSE, stderr = FALSE) : '"pdflatex"' not found
Execution halted
No TeX installation detected (TeX is required to create PDF output). You should install a recommended TeX distribution for your platform:
Windows: MiKTeX (Complete) - http://miktex.org/2.9/setup
(NOTE: Be sure to download the Complete rather than Basic installation)
Mac OS X: TexLive 2013 (Full) - http://tug.org/mactex/
(NOTE: Download with Safari rather than Chrome _strongly_ recommended)
Linux: Use system package manager
I thought it might be a PATH issue so I added the output of tinytex:::texlive_root() to my PATH and it still produced the same error.
I am not sure whether this has to do with how I did the installation or not. Any help would be greatly appreciated.
Sorry about that. There was an extra comma in paste0(). I just fixed it. You can use either the current development version or tinytex:::install_prebuilt().
The PATH issue should not exist if you restart RStudio after installing TinyTeX.
Thanks @yihui ! After reinstalling the development version and rerunning the function the installation works correctly. I guess the installation wasn't complete when I ran the function with debug.
Thanks for taking care of this so quickly!
Hi @yihui, I am also having the same problem while knitting to a PDF. I used all the debugging steps mentioned on your website. I am getting the following error. I tried to uninstall and reinstall it but I am getting the same error. I am using R4.0. Could you please tell me how can I fix it? Thanks.

When I am running tinytex::tlmgr_path() command I am getting following error:
Use of uninitialized value in bitwise or (|) at C:\Users\Javed\AppData\Roaming\TinyTeX\texmf-dist\scripts\texlive\tlmgr.pl line 1497.
@javedali99 #210
Hi @yihui can you please help with my error I am getting similar error can you please look into that.
Error in aperm.default(map, c(2, 1, 3)) :
invalid first argument, must be an array
Calls:
In addition: Warning message:
In has_crop_tools() :
Tool(s) not installed or not in PATH: pdfcrop, ghostcript
-> As a result, figure cropping will be disabled.
Execution halted
No LaTeX installation detected (LaTeX is required to create PDF output). You should install a LaTeX distribution for your platform: https://www.latex-project.org/get/
If you are not sure, you may install TinyTeX in R: tinytex::install_tinytex()
Otherwise consider MiKTeX on Windows - http://miktex.org
MacTeX on macOS - https://tug.org/mactex/
(NOTE: Download with Safari rather than Chrome _strongly_ recommended)
Linux: Use system package manager
Error in aperm.default(map, c(2, 1, 3)) :
invalid first argument, must be an array
Calls: ... eval -> get_map -> get_googlemap -> aperm -> aperm.default
@virtiparekh That's the error. I don't see how this error is similar to the one in the original post above. It looks like a completely different error and is unlikely to be relevant to tinytex.
If you are not sure, you may install TinyTeX in R: tinytex::install_tinytex()
Have you done what the message suggested you do?
Most helpful comment
Sorry about that. There was an extra comma in
paste0(). I just fixed it. You can use either the current development version ortinytex:::install_prebuilt().The PATH issue should not exist if you restart RStudio after installing TinyTeX.