【问题标题】:CPANM path not configured correctlyCPANM 路径未正确配置
【发布时间】:2016-05-10 07:59:43
【问题描述】:

提取新的 Strawberry Perl 副本后,我在 CPANM 中遇到错误。

C:\portable_perl>cpanm --self-upgrade
You are running cpanm from the path where your current perl won't install execut
ables to.
Because of that, cpanm --self-upgrade won't upgrade the version of cpanm you're
running.

  cpanm path   : C:\portable_perl\perl\bin/cpanm
  Install path : C:\portable_perl\perl\site\bin

It means you either installed cpanm globally with system perl, or use distro pac
kages such
as rpm or apt-get, and you have to use them again to upgrade cpanm.

C:\portable_perl>

安装App::cpanminus 后,我得到一个稍微不同的错误。

C:\portable_perl>cpanm --self-upgrade
You are running cpanm from the path where your current perl won't install executables to.
Because of that, cpanm --self-upgrade won't upgrade the version of cpanm you're running.

  cpanm path   : C:\portable_perl\perl\site\bin/cpanm
  Install path : C:\portable_perl\perl\site\bin

It means you either installed cpanm globally with system perl, or use distro packages such
as rpm or apt-get, and you have to use them again to upgrade cpanm.

C:\portable_perl>

有没有办法设置路径?或者以不同的方式安装 CPANM?如果这很重要,我会在 Windows 7 x64 上运行它。

【问题讨论】:

    标签: perl perl-module cpan cpanm


    【解决方案1】:

    脚本可以

    $0 !~ /^$install_base/
    

    $0 在哪里

    C:\portable_perl\perl\site\bin/cpanm
    

    $install_base

    C:\portable_perl\perl\site\bin
    

    它不需要反斜杠。 \po\pe\s\b 在正则表达式模式中都有特殊含义。这是cpanm 中的一个错误。

    【讨论】:

    • 看起来这是reported in December
    • @ThisSuitIsBlackNot 我周五花了一整天的时间试图找到答案:(
    • 当然有解决方法。有多种安装cpanm 的方法。您甚至在两次测试之间自己使用了一个。最简单的大概是cpanm cpanm
    猜你喜欢
    • 2020-04-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-09-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多