You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Strawberry Perl未预装Win32::Shortcut模块?求解决方法

解决Strawberry Perl缺少Win32::Shortcut模块的问题

问题场景

在Windows 10 Enterprise系统上安装IPDesigner开发工具时,需先部署Strawberry Perl(版本strawberry-perl-5.40.0.1-64bit.msi),但全新安装后发现缺少Win32::Shortcut模块。

运行测试脚本:

use Win32::Shortcut;
print "\nWin32::Shortcut ", Win32::Shortcut::Version, " TEST\n\n";

出现如下错误:

Can't locate Win32/Shortcut.pm in @INC (you may need to install the Win32::Shortcut module) (@INC entries checked: C:/Strawberry/perl/site/lib C:/Strawberry/perl/vendor/lib C:/Strawberry/perl/lib) at list.pl line 1.
BEGIN failed--compilation aborted at list.pl line 1.

解决方法

  • 通过CPAN客户端安装
    Strawberry Perl自带CPAN工具,打开命令提示符(CMD)或PowerShell,执行以下命令:

    cpan Win32::Shortcut
    

    若遇到交互式配置提示,直接按回车选择默认选项,工具会自动完成模块的下载、编译与安装。

  • 使用cpanm快速安装
    Strawberry Perl内置了更简洁的cpanm工具,执行命令即可跳过冗余配置,快速安装模块:

    cpanm Win32::Shortcut
    
  • 手动放置模块(备选方案)
    若网络受限无法通过工具安装,可获取Win32::Shortcut源码包,解压后将其中的Win32/Shortcut.pm文件复制到Strawberry Perl的site/lib/Win32目录(通常为C:/Strawberry/perl/site/lib/Win32),确保模块版本与你的Perl版本兼容。

内容的提问来源于stack exchange,提问作者WillG

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.15 06:02:43