I am trying to use the minted package but get the error
! Package minted Error: You must invoke LaTeX with the -shell-escape flag.
I am using MikTex and have tried going into Edit/Preferences and clicking on PdfLatex+MakeIndex+BibTex and adding -shell-escape (and also trying --shell-escape) to the arguments but then the compiler does not run at all and I get
ERROR: MiKTeX encountered an internal error.
ERROR: Info:
ERROR: Source: Libraries\MiKTeX\Core\Session/SessionImpl.h
ERROR: Line: 640
Sorry, but "MiKTeX Compiler Driver" did not succeed.