我的计算机在使用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 --reinstall
或cpanm 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:~$
如何恢复安装或重新配置/重新安装未完成的模块?
答案 0 :(得分:3)
出于某种原因,创建了几个文件但未写入或截断。这些可以在完整安装日志中轻松识别为具有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::Weaken
和Devel::GlobalDestruction
应该可以解决问题。