GitHub Actions 打包 Tinytex 环境报错记录
使用 GitHub Actions 打包环境时,在安装完成 tinytex 之后,使用 tlmgr 更新包时会报错,报错详情如下:
Installing 'tinytex' (2024.11) [64bit] from 'r-bucket' bucket
Starting download with aria2 ...
Download: [#5829f6 0B/109MiB(0%) CN:1 DL:0B]
Download: Download Results:
Download: gid |stat|avg speed |path/URI
Download: ======+====+===========+=======================================================
Download: 5829f6|OK | 64MiB/s|C:/00PackageManager/Scoop/cache/tinytex#2024.11#86eabcc.zip
Download: Status Legend:
Download: (OK):download completed.
Checking hash of TinyTeX-1-v2024.11.zip ... ok.
Extracting TinyTeX-1-v2024.11.zip ... done.
Running pre_install script...done.
Linking C:\00PackageManager\Scoop\apps\tinytex\current => C:\00PackageManager\Scoop\apps\tinytex\2024.11
Running post_install script...--> Running tlmgr path add
--> Updating tlmgr itself
tlmgr.pl: package repository https://ctan.math.illinois.edu/systems/texlive/tlnet (verified)
tlmgr.pl: no self-updates for tlmgr available
done.
'tinytex' (2024.11) was installed successfully!
Notes
-----
For full documentation, see https://yihui.org/tinytex/
tlmgr: D:\a\_temp\22a1af43-7f91-4c2f-82d0-069cb108fd48.ps1:4
Line |
4 | tlmgr update --self --all
| ~~~~~
| The term 'tlmgr' is not recognized as a name of a cmdlet, function, script file, or executable program. Check
| the spelling of the name, or if a path was included, verify that the path is correct and try again.
Error: Process completed with exit code 1.
出现错误的地方:
- 在尝试运行
tlmgr update --self --all命令时失败 - 错误信息表明系统无法识别
tlmgr命令 - 这通常意味着 TinyTeX 的二进制目录没有被正确添加到系统的 PATH 环境变量中
建议的修复步骤:
- 在运行
tlmgr之前添加以下命令刷新环境变量:
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
- 或者使用完整路径运行 tlmgr:
C:\00PackageManager\Scoop\apps\tinytex\current\bin\windows\tlmgr update --self --all