[英]latexindent: Unknown PerlIO layer 'encoding' - Formatting failed with exit code 255 macOS 12 Monterey
我嘗試使用LaTeX Workshop插件 ( v8.22.0 ) 在macOS (12.0.1)下從Visual Studio Code (1.63.0)運行latexindent
。 它不起作用,因為在格式化期間發生錯誤。
我已經安裝了這些cpan包:
我還嘗試使用此命令更新CPATH
環境變量
export CPATH=/Library/Developer/CommandLineTools/SDKs/MacOSX12.0.sdk/System/Library/Perl/5.34/darwin-thread-multi-2level/CORE:$CPATH
這也沒有奏效。
Perl
可執行文件位於此文件夾中: /opt/homebrew/bin/perl
。 我有版本v5.34.0 。 我已經閱讀了這個latexindent:從 macOS 11 Big Sur 開始安裝 File::HomeDir, Mac::SystemDirectory 的麻煩。
有人可以給我一些關於如何解決這個問題的提示嗎?
這是錯誤 output:
[23:14:18] Start formatting with latexindent.
[23:14:18] Formatting with command /Library/TeX/texbin/latexindent -c,/Users/daniel/Desktop/mwe/,/Users/daniel/Desktop/mwe/__latexindent_temp.tex,-y=defaultIndent: ' '
[23:14:18] Formatting failed with exit code 255
[23:14:18] stderr: Unknown PerlIO layer 'encoding' at /usr/local/texlive/2021basic/texmf-dist/scripts/latexindent/LatexIndent/Document.pm line 21.
Unknown PerlIO layer "encoding" at /opt/homebrew/Cellar/perl/5.34.0/lib/perl5/5.34.0/open.pm line 126.
Unknown PerlIO layer "encoding" at /opt/homebrew/Cellar/perl/5.34.0/lib/perl5/5.34.0/open.pm line 134.
Unknown PerlIO layer "encoding" at /opt/homebrew/Cellar/perl/5.34.0/lib/perl5/5.34.0/open.pm line 135.
Attempt to reload Encode.pm aborted.
Compilation failed in require at /usr/local/texlive/2021basic/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm line 130.
BEGIN failed--compilation aborted at /usr/local/texlive/2021basic/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm line 130.
Compilation failed in require at /usr/local/texlive/2021basic/texmf-dist/scripts/latexindent/LatexIndent/Verbatim.pm line 22.
BEGIN failed--compilation aborted at /usr/local/texlive/2021basic/texmf-dist/scripts/latexindent/LatexIndent/Verbatim.pm line 22.
Compilation failed in require at /usr/local/texlive/2021basic/texmf-dist/scripts/latexindent/LatexIndent/Lines.pm line 22.
BEGIN failed--compilation aborted at /usr/local/texlive/2021basic/texmf-dist/scripts/latexindent/LatexIndent/Lines.pm line 22.
Compilation failed in require at /usr/local/texlive/2021basic/texmf-dist/scripts/latexindent/LatexIndent/Document.pm line 28.
BEGIN failed--compilation aborted at /usr/local/texlive/2021basic/texmf-dist/scripts/latexindent/LatexIndent/Document.pm line 28.
Compilation failed in require at /Library/TeX/texbin/latexindent line 27.
BEGIN failed--compilation aborted at /Library/TeX/texbin/latexindent line 27.
[23:14:18] File watcher - file changed: /Users/daniel/Desktop/mwe/mwe.tex
[23:14:18] Parsing a file and its subfiles: /Users/daniel/Desktop/mwe/mwe.tex
[23:14:18] Checking for duplicate labels: /Users/daniel/Desktop/mwe/mwe.tex.
[23:14:18] Auto build started detecting the change of a file: /Users/daniel/Desktop/mwe/mwe.tex
[23:14:18] BUILD command invoked.
[23:14:18] The document of the active editor: file:///Users/daniel/Desktop/mwe/mwe.tex
[23:14:18] The languageId of the document: latex
[23:14:18] Building root file: /Users/daniel/Desktop/mwe/mwe.tex
[23:14:18] onDidSaveTextDocument triggered: file:///Users/daniel/Desktop/mwe/mwe.tex
[23:14:18] Build root file /Users/daniel/Desktop/mwe/mwe.tex
[23:14:18] outDir: /Users/daniel/Desktop/mwe
[23:14:18] Recipe step 1: lualatex, -lualatex,-shell-escape,-synctex=1,-interaction=nonstopmode,-file-line-error,/Users/daniel/Desktop/mwe/mwe
[23:14:18] Recipe step env: undefined
[23:14:18] cwd: /Users/daniel/Desktop/mwe
[23:14:18] LaTeX build process spawned. PID: 4557.
[23:14:18] LaTeX log parsed with 0 messages.
[23:14:18] A step in recipe finished. PID: 4557.
[23:14:18] Recipe step 2: biber, mwe
[23:14:18] Recipe step env: undefined
[23:14:18] cwd: /Users/daniel/Desktop/mwe
[23:14:18] LaTeX build process spawned. PID: undefined.
[23:14:18] LaTeX fatal error: spawn biber ENOENT, . PID: undefined.
[23:14:18] Does the executable exist? $PATH: /Users/daniel/perl5/bin:/Library/TeX/texbin/:/Applications/flutter/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/Library/Apple/usr/bin
[23:14:18] Does the executable exist? $Path: undefined
[23:14:18] The environment variable $SHELL: /bin/zsh
這個問題與macOS下latexindent
的安裝有關。 我在這里問了一個與此問題相關的更具體的問題,並給出了我的解決方案。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.