繁体   English   中英

latexindent:未知的 PerlIO 层“编码”-格式化失败,退出代码为 255 macOS 12 Monterey

[英]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包:

  • 日志::Log4perl (1.54)
  • 日志::调度::文件 (2.70)
  • YAML::Tiny(1.73)
  • 文件::HomeDir (1.006)
  • Unicode::GCString (2013.10)
  • 文件::HomeDir (1.006)
  • Mac::系统目录 (0.13)

我还尝试使用此命令更新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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM