我需要在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.
我用这个解决scheme
Windows 7控制面板,程序和function,selectMicrosoft Visual Studio 2008 Standard或Professional Edition应用程序,然后select卸载/更改/修改。 这将使您进入维护模式。 selectC ++,然后检查X64编译器和工具。
我有Visual Studio Express和Visual Studio Professional 2013(我不记得在我的系统中是如何或为什么的。)我按照上面的说明。 选项是不同的:一个C ++中提到它 – Microsoft Visual C ++ 2013微软基础类库。 所以,我select了那一个。 它有一个600MB的下载和安装。
我去了C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin
,发现nmake
那里。 如果你没有find它,那么你可能会发现在Microsoft Visual Studio 10,11等。在那里找nmake
。 将nmake
的path添加到PATH
环境variables。
现在,我得到一个新的错误
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
告诉我,安装到不含空格的path( C:\progs\...
)将解决我的问题。 我无法安装到另一个目录:
这个版本的Perl捆绑了其他必须安装到文件夹
"C:\Program Files (x86)"
的文件夹,这个文件夹中有一个空格。 该软件需要在其他方面正常工作的path。 有没有简单的方法来编辑试图安装模块的代码? 我可以通过更改一些代码来parsingpath。 虽然我是Perl的新手。 不知道我是否能够改变而不会造成伤害。
编辑 –
我有活动状态perl 5.1.2和perl 5.8由工具x和工具y(电动司令)使用。 工具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
你正在运行哪个版本的Perl? 如果在命令提示符下运行“perl -v”,你会得到什么?
如果你得到的版本号是5.10或更高,那么Time :: Piece应该已经包含在该版本的Perl中。 如果不是这样,那么你的安装就会以有趣的方式被破坏,你应该重新从头开始重新安装。
如果你得到的版本号低于5.10,那么你已经安装了一个令人痛苦的老版本的Perl,最好的办法是升级到更新的版本。