无法安装Time:使用cpan的Piece模块

时间:2014-11-30 05:44:04

标签: windows perl windows-7

我需要在Perl中安装Time::Piece模块。它不是出于某种原因。当我使用

cpan install Time::Piece

经过一些成功的步骤后,我得到了以下错误

.....
Checking if your kit is complete...
Looks good
Unable to find a perl 5 (by these names: "My windows path variable contents here...i think"
Writing Makefile for Time::Piece
'nmake' is not recognized as an internal or external command,
operable program or batch file.
  RJBS/Time-Piece-1.29.tar.gz
  nmake -- NOT OK
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible
Failed during this command:
 RJBS/Time-Piece-1.29.tar.gz                  : make NO

cpan[2]>

为什么会这样?请帮我解决。


我会在尝试自己修复时等待答案。第一个问题 -

'nmake' is not recognized as an internal or external command, operable program or batch file.

我使用了this solution

  

Windows 7控制面板,程序和功能,选择Microsoft   然后是Visual Studio 2008 Standard或Professional Edition应用程序   选择卸载/更改/修改。这将带您进入维护   模式。选择C ++,然后检查X64编译器和工具。

我有Visual Studio Express和Visual Studio Professional 2013(我不记得它在我的系统上是怎么或为什么。)我按照上面的说明操作。选项不同:其中一个提到了C ++ - Microsoft Visual C ++ 2013 Microsoft基础类库。所以,我选择了那个。它的下载和安装量为600MB。

我去了C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin并在那里找到了nmake。如果您在那里找不到它,那么您可能会在Microsoft Visual Studio 10中找到11等。在那里查找nmake。将nmake的路径添加到PATH环境变量。

现在,我收到一个新错误

NMAKE : fatal error U1073: don't know how to make 'C:/Program'
Stop.
  RJBS/Time-Piece-1.29.tar.gz
  nmake -- NOT OK
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible
Failed during this command:
 RJBS/Time-Piece-1.29.tar.gz                  : make NO

cpan[2]>

我也会尝试解决这个问题。顺便说一下,@ikegami告诉我安装到没有空格的路径(C:\progs\...)将解决我的问题。我无法安装到另一个目录:

  

这个版本的Perl捆绑了必须的其他软件   安装到其中有空格的文件夹"C:\Program Files (x86)"。该   软件需要在那条路上才能运行其他一些东西   正确。有没有一种简单的方法来编辑试图安装模块的代码?我可以通过改变一些来解析路径   码。我是Perl的新手。不确定我是否能够改变   没有造成伤害。

编辑 -

我有工具x和工具y(电子指挥官)使用的Active状态perl 5.1.2和perl 5.8。工具y有自己的perl库,必须在我的代码中使用。所以我坚持使用perl 5.8。

我刚才知道这是由于工具y的问题。有一个解决方法,但我无法理解它。能帮我理解windows的解决方法吗?

https://electriccloud.zendesk.com/hc/en-us/articles/202828073-KBEC-00180-Installing-Perl-modules-into-the-Commander-Perl-distribution

1 个答案:

答案 0 :(得分:2)

您运行的是哪个版本的Perl?如果你跑步,你会得到什么?perl -v"在命令提示符下?

如果您获得的版本号是5.10或更高,那么Time :: Piece应该已经包含在该版本的Perl中。如果不是,那么您的安装会以有趣的方式破坏,您应该从头开始重新安装。

如果您获得的版本号低于5.10,那么您安装了一个痛苦的旧版Perl,您最好的方法是升级到更新的版本。