gpt4 book ai didi

perl - 如何从中断的 CPAN 模块安装中恢复?

转载 作者:行者123 更新时间:2023-12-01 23:57:06 29 4
gpt4 key购买 nike

我的计算机在使用 cpanm 安装 perl 模块期间崩溃了(我猜是在安装 Carp 作为 Moose 的依赖项时)。现在,当我尝试使用我想使用的模块时,出现以下错误:

user@linux:~$ ./script_using_moose.pl 
Carp.pm did not return a true value at /usr/share/perl/5.14/diagnostics.pm line 185.
BEGIN failed--compilation aborted at /usr/share/perl/5.14/diagnostics.pm line 185.
Compilation failed in require at ./script_using_moose.pl line 5.
BEGIN failed--compilation aborted at ./script_using_moose.pl line 5.
user@linux:~$

如果我尝试(重新)安装包(使用 cpanm --reinstallcpanm force),我会得到另一个(类似的)错误:

user@linux:~$ sudo cpanm --force Moose
Carp.pm did not return a true value at /usr/local/share/perl/5.14.2/Parse/CPAN/Meta.pm line 6.
BEGIN failed--compilation aborted at /usr/local/share/perl/5.14.2/Parse/CPAN/Meta.pm line 6.
Compilation failed in require at /loader/0x1692090/App/cpanminus/script.pm line 11.
BEGIN failed--compilation aborted at /loader/0x1692090/App/cpanminus/script.pm line 11.
Compilation failed in require at /usr/bin/cpanm line 2029.
BEGIN failed--compilation aborted at /usr/bin/cpanm line 2029.
user@linux:~$

如何恢复安装或重新配置/重新安装不完整的模块?

最佳答案

出于某种原因,创建了几个文件但未写入或被截断。这些可以在完整的安装日志中轻松识别为具有 undef 版本号的模块:

Checking dependencies from MYMETA.json ...
...
Checking if you have Task::Weaken 0 ... Yes (undef)
...
Checking if you have Devel::GlobalDestruction 0 ... Yes (undef)

重新安装模块 Task::WeakenDevel::GlobalDestruction 应该可以解决问题。

关于perl - 如何从中断的 CPAN 模块安装中恢复?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23046129/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com