Closed KES777 closed 2 years ago
Can not understand where it founds that module:
perl -MNumber::Phone -e0
Can't locate Number/Phone.pm in @INC (you may need to install the Number::Phone module) (@INC contains: /opt/perlbrew/perls/perl-5.34.1/lib/site_perl/5.34.1/x86_64-linux /opt/perlbrew/perls/perl-5.34.1/lib/site_perl/5.34.1 /opt/perlbrew/perls/perl-5.34.1/lib/5.34.1/x86_64-linux /opt/perlbrew/perls/perl-5.34.1/lib/5.34.1).
BEGIN failed--compilation aborted.
Would be nice if -v
also prints location where module was found:
Found Number::Phone 3.8005 which doesn't satisfy == 3.7003.
print $INC{'Number::Phone'}
Module Number::Phone 3.8005 should be reinstalled because --reinstall flag was provided.
that's not what --reinstall
is supposed to do.
You're probably pinning the Number::Phone module in cpanfile
, but then pulled 02packages.details.txt.gz
from CPAN, which does not have that version, because public CPAN only supports listings of current modules.
You really have to use Carmel for all this. Carmel allows you to manage these versions snapshotted and commit to your repo, and then use cpanm or cpm to deploy on a remote host.
https://metacpan.org/pod/Carmel#Production-Deployments
On your local environment, run:
carmel install
carmel package
this will create a bunch of new files, such as cpanfile.snapshot
, and all tarballs and 02packages under vendor
. Commit them to your repo, or zip them as you want.
On another machine, run:
cpanm -l local --installdeps . --from file://$PWD/vendor/cache
this will install all the modules, exactly the versions specified in cpanfile.snapshot
, using the package files found in vendor/cache
, to a library path ./local/lib/perl5
.
Probably that is wrong, because host requires to install modules into system perl. But this system already had newer 'Number::Phone' and installation fails (( Is there a way to workaround that?
Probably that is wrong, because host requires to install modules into system perl.
Technically speaking, you should be able to install modules to any location. There's no technical restriction from perl standpoint that you must install to system perl. You can continue to use system perl, then install modules to a separate directory, then point the library path (via use lib
or PERL5LIB
). This is a standard feature of perl, and it doesn't make sense you're saying "I can't use this standard perl feature."
Having said that, you might have a policy that you have to install modules to site_perl of your system perl. That is a weird policy with virtually no technical merits, but anyone has the freedom to implement such policy.
Either way,
cpanm -l local --installdeps . --from file://$PWD/vendor/cache
this was just an example. You can change the option (remove -l local
) to install to site_perl, or use -L local
(upper case L, to include --self-contained
) to ignore the versions that are already in system perl's site_perl. Perhaps that's what you meant.
start here I manually download
02packages.details.txt.gz
intovendor/modules
and rerun:Module
Number::Phone 3.8005
should be reinstalled because--reinstall
flag was provided.