Skip to content
Latchkey

cpanm "installdeps" from cpanfile failed in CI

cpanm parsed the cpanfile and tried to install every declared dependency; one of them failed. As with any cpanm failure, the summary points at build.log for the real cause.

What this error means

cpanm --installdeps . ends with "! Installing the dependencies failed: ..." and lists the modules it could not install.

cpanm
--> Working on .
Configuring App-MyApp ... OK
! Installing the dependencies failed: Module 'XML::LibXML' is not installed
! Bailing out the installation for App-MyApp.

Common causes

An XS dependency needs system libraries

A module like XML::LibXML compiles against libxml2; without the -dev package the build fails and installdeps bails out.

A test or version constraint could not be met

A declared minimum version or a failing self-test in a dependency stops the batch install.

How to fix it

Install system libraries then installdeps with --notest

  1. Install the -dev libraries the XS dependencies need.
  2. Run cpanm --installdeps with --notest to skip dependency self-tests.
  3. Run your own tests afterward.
Terminal
sudo apt-get update
sudo apt-get install -y build-essential libxml2-dev zlib1g-dev
cpanm --notest --installdeps .

Include develop dependencies when needed

Add --with-develop so develop-phase modules from the cpanfile are installed too.

Terminal
cpanm --notest --installdeps --with-develop .

How to prevent it

  • Install XS -dev system libraries before installdeps.
  • Use --notest for dependency installs; run project tests separately.
  • Keep cpanfile phases (runtime/test/develop) accurate.

Frequently asked questions

What causes ""cpanm --installdeps ." fails"?
A module like XML::LibXML compiles against libxml2; without the -dev package the build fails and installdeps bails out.
How do I fix "cpanm --installdeps ." fails?
Install system libraries then installdeps with --notest

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card