LaTeX-Workshop on VS Code keeps printing this error:

latexmk: The script engine could not be found.
latexmk: Data: scriptEngine="perl.exe", scriptName="latexmk"

I installed 'latexmk' via MikTeX 2.9, yet it still gives me this message. What do I have to do?


Quick summary:

  1. Install Perl from The Perl Programming Language. ActiveState Perl is recommended for beginners. Make sure to add the Perl local directory to your system Path.
  2. Install the latexmk package with your TeX distribution.
  • 1
    If you had used texlive instead of miktex, perl would have been included.
    – daleif
    Dec 1 '18 at 12:45
  • 2
    @daleif perfectly true, however many OLD install instructions still assume MiKTeX includes Perl as it formerly did. It may be worth mentioning that like TeX Live is "fuller" than incremental TeX such as W32 or Tiny or MiKTeX equally the fuller version of Perl should be the Strawberry flavour but MiKTeX plus ActiveState will be good enough for most latexmk on windows users.
    – user170109
    Dec 1 '18 at 13:10
  • 2
    K. Paul it may be worth mentioning that there are two things to check after installing Perl 1) check perl has included itself on the system path 2) check that the path is not terminated by a final semicolon; as this can supposedly upset latexmk searching beyond end of ; separated path for a non existent final entry.
    – user170109
    Dec 1 '18 at 13:16

That error occur because VS Code can't find perl (on your environment path).

You can test if it's exist or not using:

perl -v

If you already install MikTeX and VSCode, I suggest you install perl via Strawberry Perl.

Step by step Strawberry Perl installation for windows based on this source is:

  1. Make sure you do not have any version of Perl already installed. Check both add/remove programs and C:\Strawberry.
  2. Download msi file. As for this writing, choose between strawberry-perl- or strawberry-perl-, same as your system (64 or 32).
  3. Install.

To test your installation is success and Path already added, test using:

perl -v

Note: I already try install perl using ActiveState Perl, and the error persist. This is due to ActiveState installation will use ActiveState environment and does not add perl to Path. This might help a new user.

  • As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Oct 3 at 17:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.