SHORT QUESTION
I've installed cpanm on Mac mini G4 Leopard 10.5.8 with perl-8.8.8 using /usr/bin/cpan -i App::cpanminus and then **sudo** /usr/bin/cpan -i App::cpanminus It said App::cpanminus is up to date. but no cpanm is available in /usr/bin or anywhere else.
NOTE I've looked up the questionCan't locate module in @INC but CPAN says module is up to date and some others which seemed related to my case but they didn't help. Not much information is available in Google searches either.
LONG QUESTION
I've installed cpanm on Mac mini G4 Leopard 10.5.8 with perl-8.8.8 using /usr/bin/cpan -i App::cpanminus
All the downloading, extracting, compiling, etc went smoothly but at the last step, before installing it as (As Far As I Can Remember / AFAICR) /usr/bin/cpanm it stopped with a permission error (AFAICR) So I've repeated the same line with sudo:
~ $ sudo /usr/bin/cpan -i App::cpanminus
this time it said (again, AFAICR)
CPAN: Storable loaded ok
Going to read /Users/Mac/.cpan/Metadata
Database was generated on Thu, 09 Dec 2021 18:17:02 GMT
App::cpanminus is up to date.
and it didn't place the cpanm into /usr/bin or any other PATH directory.
Note that I need to use solely perl, v5.8.8 because it is the only version compatible with some of the system level Perl applications.
When I did a search on the ~/.cpanm and the default Mac OS X Perl installation folder which is /System/Library/Perl no instance of cpanm was found. So I gather cpanm is not created at all.
I've deleted the /Users/Mac/.cpan and repeated the sudo install and it ended up with the same message above (again, AFAICR)
So I got stuck in this. I didn't do anything else other than deleting ~/.cpan
How to install cpan on this Mac ?
Note 2 My question's title might not be best. Anyone is free to edit the title or the question.
Edit 1
I've tried the -f option but it said unknown option f
Here is how it goes:
~ $ sudo /usr/bin/cpan -if App::cpanminus
Unknown option: f
CPAN: Storable loaded ok
Going to read /Users/Mac/.cpan/Metadata
^C
~ $ sudo /usr/bin/cpan -f App::cpanminus
Unknown option: f
CPAN: Storable loaded ok
Going to read /Users/Mac/.cpan/Metadata
^C
~ $ sudo /usr/bin/cpan -f -i App::cpanminus
Unknown option: f
CPAN: Storable loaded ok
Going to read /Users/Mac/.cpan/Metadata
Database was generated on Thu, 09 Dec 2021 18:17:02 GMT
CPAN: LWP::UserAgent loaded ok
Fetching with LWP:
http://www.cpan.org/authors/01mailrc.txt.gz
Going to read /Users/Mac/.cpan/sources/authors/01mailrc.txt.gz
Fetching with LWP:
http://www.cpan.org/modules/02packages.details.txt.gz
Going to read /Users/Mac/.cpan/sources/modules/02packages.details.txt.gz
Database was generated on Fri, 10 Dec 2021 19:29:02 GMT
There's a new CPAN.pm version (v2.29) available!
[Current version is v1.7602]
You might want to try
install Bundle::CPAN
reload cpan
without quitting the current session. It should be a seamless upgrade
while we are running...
Fetching with LWP:
http://www.cpan.org/modules/03modlist.data.gz
Going to read /Users/Mac/.cpan/sources/modules/03modlist.data.gz
Going to write /Users/Mac/.cpan/Metadata
App::cpanminus is up to date.
And surely enough there's still no cpanm installed.
Edit 2
Output of the cpan -D App::cpanminus (only the meaningful lines included)
Would you like to configure as much as possible automatically? [yes] yes
Reading '/Users/Mac/.cpan/Metadata'
Database was generated on Fri, 10 Dec 2021 19:29:02 GMT
App:cpanminus
-------------------------------------------------------------------------
(no description)
M/MI/MIYAGAWA/App-cpanminus-1.7044.tar.gz
(no installation file)
Installed: not installed
CPAN: 1.7044 Not up to date
Tatsuhiko Miyagawa (MIYAGAWA)
[email protected]
A few things to note:
The cpan output should tell you where it installed things. Do you have the output? To try again, you can force install with
cpan -fto see what happened.The .cpan/ directory is just a work directory for CPAN.pm. However, you can go into its build/ directory and find the directory for the thing you are having trouble with to look at its build files. The Makefile will have settings such as
INSTALLBINandINSTALLSITEBIN(and some others) that notes where it decided to install things. Apple has typically set these to whatever they wanted for you already, so it's slightly different than the default perl behavior.You've likely installed the cpanm script in one of perl's directories. Perl modules typically do not install into a common directory without you doing something special. There's likely a bin directory at the same level as the lib/ directory. See where you installed the module and then look for that bin/
I like to leave the Perl programs in that bin directory and make links to them if I want them somewhere else in my path (Make links to per version tools.
The
-iswitch to cpan is just extra typing. It's implied in almost every case where you would use it.You get the permission error because you are using the system Perl and installing things into the directories it set up. Apple is pretty good about segregating that, but I don't remember how well they were doing that back then. A system update (heh, in your case unlikely ;) might overwrite or delete your work. Many people use a separate, user-installed perl and pretend the system perl does not exist.