ic23oluk has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks, every time, when im trying to install a Perl module via cpan i get the following error message:

ERROR: Can't create '/Library/Perl/5.18/HTTP' mkdir /Library/Perl/5.18/HTTP: Permission denied at /System/Library/Pe +rl/5.18/ExtUtils/Install.pm line 469. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!! at -e line 1. make: *** [pure_site_install] Error 13 OALDERS/HTTP-Message-6.13.tar.gz /usr/bin/make install -- NOT OK
can anyone help me? I am using mac os sierra

Replies are listed 'Best First'.
Re: cpan error - module installation
by marto (Cardinal) on Jul 28, 2017 at 13:49 UTC

      Thanks for your reply, but I dont really understand, because this website recommends the module local::lib in order to set the installation settings, but i obviously get the same error when trying to install it.

      Isn't there a simple way to give the permission?

        You could use sudo to run the cpan command, but you may want to leave the system perl alone. Did you look at the second link:

        curl -L http://cpanmin.us | perl - -l ~/perl5 App::cpanminus local::lib

        "This will install either cpanminus and local::lib (and all other required modules) locally into $HOME/perl5 directory."

        Follow the other config step which follows and you should be fine. If you look at local::lib it describes the boostrapping technique used.

        Yes, you can use sudo to run the command.

        BE WARNED that it can be very dangerous to modify your system Perl in any way, and in some cases can render your machine inoperable.

        You're best to do something along the lines of what marto said, or install and use Perlbrew, which is a Perl management system, allowing you to install any versions you want, all in the safety of your home directory.