无网服务器安装Excel::Writer::XLSX遇SUPER依赖检测异常
Hey there, let's figure out why your Sub::Identify install isn't being picked up when you try to install SUPER. I've gone through your commands and output, and here's a breakdown of the problem and how to resolve it:
Your Current Scenario
You're trying to install Excel::Writer::XLSX on an offline server, which requires the dependency chain: Sub::Identify → SUPER → Excel::Writer::XLSX. You thought you successfully installed Sub::Identify, but the SUPER installation scripts keep reporting that the dependency is missing. Here's your workflow and the corresponding output:
Sub::Identify Setup & Verification
cd Sub-Identify-0.14 perl MakeFile.pl perldoc -l Sub::Identify
Output:
lib\Sub\Identify.pm\
SUPER Installation Errors
cd SUPER-1.20141117 perl Build.PL
Output:
Sub::Identify is not installed
perl Makefile.PL
Output:
Warning: prerequisite Sub::Identify 0 not found.
Why This Is Happening
The key clue here is the perldoc -l output: lib\Sub\Identify.pm\ (note the trailing backslash). This suggests you only ran Makefile.PL to generate the build files, but never completed the actual installation steps (like make and make install on Unix-like systems, or dmake/nmake on Windows).
Running Makefile.PL just creates the instructions for building the module—it doesn't copy the module files into Perl's system library paths. That's why SUPER's install scripts can't find Sub::Identify, even though the files exist in your local directory.
Step-by-Step Fixes
1. Complete the Full Sub::Identify Installation
Head back to the Sub-Identify-0.14 directory and run the full installation workflow tailored to your OS:
For Unix-like Systems (Linux/macOS)
cd Sub-Identify-0.14 perl Makefile.PL make make test # Optional but recommended—verifies the module works correctly make install
For Windows Systems (e.g., Strawberry Perl)
cd Sub-Identify-0.14 perl Makefile.PL dmake dmake test dmake install
Note: If you don't have root/admin privileges, you can install to a custom directory with:
perl Makefile.PL PREFIX=/path/to/your/custom/perl/libThen ensure this path is added to Perl's module search path by setting the
PERL5LIBenvironment variable:export PERL5LIB=/path/to/your/custom/perl/lib:$PERL5LIB # Unix-like set PERL5LIB=C:\path\to\your\custom\perl\lib;%PERL5LIB% # Windows
2. Verify Sub::Identify Is Properly Installed
Run the verification command again. A successful install will return the full system path to the module, not a relative path:
perldoc -l Sub::Identify
Example valid outputs:
- Unix-like:
/usr/local/lib/perl5/site_perl/5.36/Sub/Identify.pm - Windows:
C:\strawberry\perl\site\lib\Sub\Identify.pm
If you still get a relative path, check for any error messages during the install step, or confirm you have the necessary permissions to write to Perl's library directories.
3. Reinstall SUPER
Once Sub::Identify is properly installed, go back to the SUPER-1.20141117 directory and run the install again:
Using Build.PL
cd SUPER-1.20141117 perl Build.PL ./Build ./Build test ./Build install
Using Makefile.PL
cd SUPER-1.20141117 perl Makefile.PL make # Or dmake/nmake for Windows make test make install
This time, the scripts should detect Sub::Identify without issues.
4. Install Excel::Writer::XLSX
With SUPER successfully installed, you can now follow the same offline installation process for Excel::Writer::XLSX.
内容的提问来源于stack exchange,提问作者fexlneb

