SolvedLaTeX Workshop LaTeX toolchain terminated with error


Building a .tex file does not work. latexmk and texlive is properly installed.

How to reproduce

  1. Open a .tex file
  2. Press ctrl+shift+p
  3. Search for Build LaTeX project and hit enter.

Expected behavior

Correct PDF is created.

Actual behavior

In the .tex file folder filename.fdb_latexmk and filename.aux are generated.
filename.fdb_latexmk contains:

# Fdb version 3
["pdflatex"] 1499886694 "/home/nfode/test/test.tex" "test.pdf" "test" 1499886694
  "/home/nfode/test/test.tex" 1499886430 2444 f714e27fca8b549e8ee059a2ea1aa60f ""
  "test.aux" 1499886441 8 a94a2480d3289e625eea47cd1b285758 ""

filename.aux contains:


And there is the error: LaTeX toolchain terminated with error in the statusbar.

LaTeX Workshop log messages

Log messages
There are no log messages.
17 Answers

✔️Accepted Answer

I had to completely restart VS Code (quit all instances) before it was able to find latexmk.

Other Answers:

[17:58:35] LaTeX fatal error: spawn latexmk ENOENT, . Does the executable exist?

The extension cannot find latexmk, which should be in PATH. Otherwise, you need to specify its location.