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

问题描述 投票:0回答:2

我尝试使用

LaTeX Workshop
插件 (v8.22.0) 从 Visual Studio Code (1.63.0)macOS (12.0.1) 下运行 latexindent。 它不起作用,因为格式化期间发生错误。

我已经安装了这些 cpan 软件包:

  • 日志::Log4perl (1.54)
  • 日志::调度::文件(2.70)
  • YAML::小(1.73)
  • 文件::主目录 (1.006)
  • Unicode::GCString (2013.10)
  • 文件::主目录 (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 时出现问题

有人可以给我一些如何解决这个问题的提示吗?

这是错误输出:

[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
perl visual-studio-code cpan macos-monterey
2个回答
0
投票

此问题与macOS下安装

latexindent
有关。我已经在here提出了与此问题相关的更具体的问题,并给出了我的解决方案。


0
投票

就我而言,我只需要像这样用自制软件安装乳胶缩进

brew 安装 Latexident

© www.soinside.com 2019 - 2024. All rights reserved.