Win32-SerialPort安装错误

时间:2017-03-09 12:10:02

标签: perl

当尝试在Windows命令提示符下安装Win32-SerialPort时出现以下错误,使用activeperl 5.24.1 build(2402)64位,任何人都可以告诉它出错了以及如何使用win32 :: SerialPort,我有安装了草莓和主动perl

cmd> perl -MCPAN -e shell

cpan>  install Win32::SerialPort
Database was generated on Thu, 09 Mar 2017 12:01:53 GMT

Running install for module 'Win32::SerialPort'
Fetching with LWP:
http://cpan.strawberryperl.com/authors/id/B/BB/BBIRTH/Win32-SerialPort-0.22.tar.gz
Fetching with LWP:
http://cpan.strawberryperl.com/authors/id/B/BB/BBIRTH/CHECKSUMS
Checksum for C:\STRAWB~1\cpan\sources\authors\id\B\BB\BBIRTH\Win32-SerialPort-0.22.tar.gz ok
Scanning cache C:\STRAWB~1\cpan\build for sizes
............................................................................DONE
Configuring B/BB/BBIRTH/Win32-SerialPort-0.22.tar.gz with Makefile.PL
Can't spawn "cmd.exe": No such file or directory at Makefile.PL line 35.
Device COM1 does not appear to exist. Testing impossible
No 'Makefile' created  BBIRTH/Win32-SerialPort-0.22.tar.gz
  C:\Strawberry\perl\bin\perl.exe Makefile.PL -- NOT OK
Stopping: 'install' failed for 'Win32::SerialPort'.
Failed during this command:
 BBIRTH/Win32-SerialPort-0.22.tar.gz          : writemakefile NO -- No 'Makefile' created

修改

根据Jens的建议,我已将路径设置为set PATH=%PATH%;C:\windows\system32

感谢您的建议" cmd.exe"错误消失但是 现在出现以下错误,任何解决方案?

Test Summary Report
-------------------
t/test1.t (Wstat: 256 Tests: 309 Failed: 1)
  Failed test:  157
  Non-zero exit status: 1
t/test2.t (Wstat: 256 Tests: 146 Failed: 1)
  Failed test:  27
  Non-zero exit status: 1
t/test3.t (Wstat: 256 Tests: 264 Failed: 1)
  Failed test:  149
  Non-zero exit status: 1
t/test4.t (Wstat: 256 Tests: 518 Failed: 1)
  Failed test:  366
  Non-zero exit status: 1
t/test7.t (Wstat: 512 Tests: 90 Failed: 2)
  Failed tests:  21-22
  Non-zero exit status: 2
Files=7, Tests=1808,  6 wallclock secs ( 0.27 usr +  0.05 sys =  0.31 CPU)
Result: FAIL
Failed 5/7 test programs. 6/1808 subtests failed.
dmake.exe:  Error code 130, while making 'test_dynamic'
  BBIRTH/Win32-SerialPort-0.22.tar.gz
  C:\STRAWB~1\c\bin\dmake.exe test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports BBIRTH/Win32-SerialPort-0.22.tar.gz

另外我使用Activeperl和strwaberry perl会有问题吗?

1 个答案:

答案 0 :(得分:0)

草莓 Perl 版本 > 5.32:

这个问题应该在 Strawberry Perl 5.32 上解决,Win32::SerialPort 模块会默认安装。


草莓 Perl 版本 <5.32:

如果您需要安装 Win32::SerialPort 模块但 Strawberry Perl < 5.32,这里有一个解决方案:

  1. 下载模块 tar ball:
<块引用>

http://cpan.strawberryperl.com/authors/id/B/BB/BBIRTH/Win32-SerialPort-0.22.tar.gz

  1. 解压,你会得到这个文件夹: enter image description here

  2. 修改了 Makefile.PL 以注释掉所有“COM1”部分: enter image description here

  3. 使用cmd:

<块引用>
cd Win32-SerialPort-0.22
perl Makefile.PL
dmake
dmake install
  1. 享受吧!