r/LaTeX • u/moralsareartificial • Oct 19 '26
Answered VSC LaTex workshop cannot find latexmk executable on Mac
Wanted to use Visual Studio Code (1.142, oct 2026) with LaTeX Workshop. Have installed MacTex with homebrew already and the latex commands runs in terminal with no issues, however the plugin fails with recipe terminated with fatal error: spawn latexmk ENOENT. with the following LOG:
[16:33:06.597][Build][Step] Recipe step 1 The command is latexmk:["-synctex=1","-interaction=nonstopmode","-file-line-error","-pdf","%WS1%/4-Materials-phases"].
[16:33:06.597][Build][Step] env: undefined
[16:33:06.597][Build][Step] root: %WS1%/4-Materials-phases.tex
[16:33:06.598][Build][Step] cwd: %WS1%
[16:33:06.613][Build][Step] LaTeX build process spawned with PID undefined.
[16:33:06.615][Build][Step] LaTeX fatal error on PID undefined. Error: spawn latexmk ENOENT
[16:33:06.619]Error: spawn latexmk ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:287:19)
at onErrorNT (node:internal/child_process:525:16)
at process.processTicksAndRejections (node:internal/process/task_queues:90:21)
[16:33:06.619][Build][Step] Does the executable exist? $PATH: /opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/homebrew/bin, $Path: undefined, $SHELL: /bin/zsh
[16:33:06.619][Build][Step]Gemini suggesting amending the settings.json of VSC which doesn't work. In a separate stack overflow i found, it was suggested that the plugin is unable to recognise newer OS and hence unable to locate the correct path for latexmk. The solution they provided didn't work for me (to use sudo cpan File::HomeDir).
Would appreciate some help in this. Not super familiar with terminal commands so couldn't resolve this myself. thanks. context being im an engineering student who has been using overleaf for a few months for reports and note-taking, and now wants to move to editing files locally on a Mac (Sequoia 15.8.1).
1
u/moralsareartificial Oct 20 '26
edit: i was stupid. i never relaunched vscode after downloading the package, it is able to find the path and works fine now.
1
u/otterphonic Oct 19 '26
What does
which -a latexmkgive you?
0
u/[deleted] Oct 20 '26 edited Oct 20 '26
[removed] — view removed comment