1

I am trying to install some missing Perl modules because when I run my Perl script I am getting the error:

Can't locate Net/SFTP.pm in @INC (you may need to install the Net::SFTP module)

The first step I have taken to install this is:

I have brought up CPAN in CMD and run the command cpan> install foo but no luck because after I run the command I am getting:

Fetching with LWP:
http://cpan.strawberryperl.com/authors/01mailrc.txt.gz

I am on a proxy so I am wondering if there is a way round the proxy?

Another step I have taken is that I have installed strawberry Perl from http://strawberryperl.com/ but still no luck.

Lastly, I have the file 01mailrc.txt.gz locally install in my download folder but not sure how to install it.

FYI: I am on Windows. I have not used Perl before. The Perl version I use is:

This is Perl 5, version 26, subversion 1 (v5.26.1) built for MSWin32-x64-multi-thread

Could someone help me on this or show me a way around on how to install it?

Mofi
  • 46,139
  • 17
  • 80
  • 143
Rich
  • 177
  • 2
  • 3
  • 13
  • So you are on Windows, and you are behind a proxy. What Perl did you use before you installed Strawberry? Did you have an ActivePerl installation? – simbabque Oct 26 '17 at 07:46
  • I am on windows and i am behind a proxy. I have not used Perl before, the Perl version i do have is 'This is Perl 5, version 26, subversion 1 (v5.26.1) built for MSWin32-x64-multi-thread'.So i just downloaded the most recent Strawberry and never had ActivePerl because its my first time using Perl. – Rich Oct 26 '17 at 07:49
  • Your question said you had a `cpan` client installed, and that after that worked, but didn't install anything, you installed Strawberry. So what was it before? In any case, it seems you need to set the proxy configuration. – simbabque Oct 26 '17 at 07:49
  • Refer to http://www.perlmonks.org/?node_id=982508 for how to set the proxy in your `cpan` client. It also explains how to build LWP by hand if it's not there yet. – simbabque Oct 26 '17 at 07:51
  • I never said it worked, i just typed CPAN in CMD and in CMD it returned cpan> so i am assuming thats the cpan shell? and im not sure about the proxy details but i know for sure i am behind a proxy – Rich Oct 26 '17 at 07:51
  • If you don't know the proxy settings, you're out of luck. Telling `cpan` about them is quite easy, but you have to know them. Maybe they are in your internet settings in the operating system, or deep inside your browser settings. Poke around there to find them, then follow that guide. – simbabque Oct 26 '17 at 07:52
  • do i just need to input the http proxy or ftp proxy? – Rich Oct 26 '17 at 07:55
  • I am not certain. I believe it will try HTTP first, then FTP, so either one should work. – simbabque Oct 26 '17 at 07:56
  • After I save the proxy setting then I just need to run the cpan> install foo and it should install the modules i need? – Rich Oct 26 '17 at 07:59
  • Yes. `install Net::SFTP` in your case I guess. – simbabque Oct 26 '17 at 08:00
  • Related: https://stackoverflow.com/q/42649791/1331451 – simbabque Oct 26 '17 at 08:01
  • @simbabque, i added the http and ftp proxy and i ran the command install foo and got a error of Catching error: "Proxy must be specified as absolute URI; '.........:8080' i s not at C:\\Strawberry\\perl\\lib/CPAN/FTP.pm line 357.\cJ" at C:/Strawberry/pe rl/lib/CPAN.pm line 392, line 5. – Rich Oct 26 '17 at 08:13
  • is there a way to install the 01mailrc.txt.gz as i have it install locally – Rich Oct 26 '17 at 08:15
  • Looks like you used the wrong format for the proxy URL. Does it start with `http` or `https`? – simbabque Oct 26 '17 at 08:18
  • _is there a way to install the 01mailrc.txt.gz as i have it install locally_ - I don't know. – simbabque Oct 26 '17 at 08:18
  • the way i added the proxy for HTTP_proxy is - Your http_proxy? [I_PUT_MY_IP_HERE:8080] and added my user id and password and then i done a commit – Rich Oct 26 '17 at 08:20
  • The CPAN client needs to download fresh index files such as the mailrc in order to search for the most recent version of your requested modules and their dependencies. That may take a moment. What happens *after* the “Fetching with LWP” message? That message is not an error. Does the request time out, do you get an error, is the correct module going to be downloaded? – amon Oct 26 '17 at 08:34
  • the request times out – Rich Oct 26 '17 at 08:41

0 Answers0