我想知道为什么我已经安装了依赖项,但仍然收到“安装依赖项失败:模块'Module :: Name'未安装”的错误。 我正在使用
perlbrew
和cpanm
。 以下是我尝试安装许多模块时发生的示例:
- 我尝试按照以下方式安装
URI :: ws
hamid@caspian:~$ /home/hamid/perl5/perlbrew/bin/cpanm --installdeps URI::ws
--> Working on URI::ws
Fetching http://www.cpan.org/authors/id/P/PL/PLICEASE/URI-ws-0.03.tar.gz ... OK
Configuring URI-ws-0.03 ... OK
==> Found dependencies: URI
--> Working on URI
Fetching http://www.cpan.org/authors/id/E/ET/ETHER/URI-1.67.tar.gz ... OK
Configuring URI-1.67 ... OK
Building and testing URI-1.67 ... OK
Successfully installed URI-1.67
! Installing the dependencies failed: Module 'URI' is not installed
! Bailing out the installation for URI-ws-0.03.
1 distribution installed
2. 这告诉我URI
未安装。因此,我按以下方式安装了URI
:
我回到最初想要的hamid@caspian:~$ /home/hamid/perl5/perlbrew/bin/cpanm URI --> Working on URI Fetching http://www.cpan.org/authors/id/E/ET/ETHER/URI-1.67.tar.gz ... OK Configuring URI-1.67 ... OK Building and testing URI-1.67 ... OK Successfully installed URI-1.67 1 distribution installed
URI::ws
,下面是它的内容:
hamid@caspian:~$ /home/hamid/perl5/perlbrew/bin/cpanm URI::ws
--> Working on URI::ws
Fetching http://www.cpan.org/authors/id/P/PL/PLICEASE/URI-ws-0.03.tar.gz ... OK
Configuring URI-ws-0.03 ... OK
==> Found dependencies: URI
--> Working on URI
Fetching http://www.cpan.org/authors/id/E/ET/ETHER/URI-1.67.tar.gz ... OK
Configuring URI-1.67 ... OK
Building and testing URI-1.67 ... OK
Successfully installed URI-1.67
! Installing the dependencies failed: Module 'URI' is not installed
! Bailing out the installation for URI-ws-0.03.
1 distribution installed
有人能告诉我这是为什么,以及我可以做些什么来阻止它吗?如果还有我遗漏的需要您了解的信息,请告诉我。
谢谢
cpanm
试图从哪里读取它? - chorobacpanm
安装在一个奇怪的位置;它是否通过正确的perl
运行? - friedocpanm
(请参考 http://www.perlbrew.pl/Perlbrew-and-Friends.html) - 所以这可能是可以的。可能会干扰事情的是,如果您将自己的local::lib
和环境变量(例如$PERL5LIB
)与 Perlbrew 的环境混合使用(当然也可以使用lib
命令在 Perlbrew 中“内部”使用local::lib
环境)。请问您的 Perlbrew 使用的版本中是否已安装URI?(即,在 Perlbrew 目录层次结构中是否存在文件)。 - G. Citofind ~/perl5/perlbrew/ -name "*URI*"
没有任何输出。 - HamsterPERLBREW_
环境变量都设置了吗?你的环境中是否存在类似于PERL_CPANM_OPT
、PERL_LOCAL_LIB_ROOT
或PERL5LIB
的东西可能会搞砸事情? - G. Cito