5
$ perl -MCPAN -e 'install XML::Simple'

Reading '/u/.cpan/Metadata'
  Database was generated on Fri, 14 Oct 2016 19:29:02 GMT
Running install for module 'XML::Simple'
Checksum for /u/.cpan/sources/authors/id/G/GR/GRANTM/XML-Simple-2.22.tar.gz ok
directory tmp-9128 changed before chdir, expected dev=235194353 ino=7590237479028601933, actual dev=235194353 ino=15919093302750535503, aborting. at /usr/share/perl5/core_perl/CPAN/Distribution.pm line 623.

Please suggest any solution, even manually download and install is not working.

Amit Mahajan
  • 895
  • 6
  • 34
  • what version of perl? what OS? what other modules did you try? for `XML::Simple`, did you read [this](https://metacpan.org/pod/XML::Simple#STATUS-OF-THIS-MODULE) notice by the author? – stevieb Oct 14 '16 at 20:58
  • mingw64 is git bash shell in windows 8.1, by the way the same module works in Linux. – Amit Mahajan Oct 14 '16 at 22:05
  • 1
    This happened to me a lot recently with cygwin on a new laptop with Windows 10. Eventually it stopped doing this. Sorry I don't know why it happened or why it stopped. Manual download and install should work (though it will be a pain to deal with each dependency yourself), unless it is "not working" in a different way. – mob Oct 14 '16 at 22:07
  • @mob I don't have a win10 box, but would something like this work? `wget https://cpan.metacpan.org/authors/id/M/MI/MIROD/XML-Twig-3.49.tar.gz`, then the typical `perl Makefile.PL && make && make test && make install` – stevieb Oct 14 '16 at 23:01
  • That's the basic idea. There are still a lot of ways it can go wrong (other Perl dependencies, missing libraries, broken tool chain, module ultimately not supported on Cygwin, ...) – mob Oct 14 '16 at 23:04
  • It is now 2023 and `cpan` still broken in mingw64. Have all left the room for Python ? – Axel Bregnsbo Jan 08 '23 at 16:22

3 Answers3

2

After much discussion found no solution to this and it seems the Mingw/git bash shell does not support all the CPAN modules, even though the same works fine from Linux boxes and I was able to use it from local Virtual Box setup.

Amit Mahajan
  • 895
  • 6
  • 34
2

Git Bash installs perl along with /usr/bin/core_perl/cpan, but it doesn't actually come with the CPAN:: module.

There's a lot about Git Bash I'm starting to hate in regards to how it looks like it supports something even when it doesn't. It's like someone took a pocket knife to a perfectly good MINGW install and sliced it up like a rotten apple.

They even copied cygpath into their install so that people could convert paths. It's really starting to look like the sensible thing is to just install Cygwin and give up on Git Bash.

Keith Tyler
  • 719
  • 4
  • 18
1

Install Strawberry Perl. Then in a normal Windows cmd shell do:

C:\Users\abb> cpanm XML::Simple

Then back in Git Bash invoke Perl with /c/Strawberry/perl/bin/perl.exe or update the shebang in your script to:

#!/c/Strawberry/perl/bin/perl.exe
Axel Bregnsbo
  • 3,773
  • 2
  • 22
  • 16