Skip to content
Latchkey

Perl "cpan[1]>" interactive config prompt hangs CI

The classic CPAN.pm client tries to configure itself interactively on first run and waits for input. In CI there is no TTY, so the job hangs until it times out. You must run everything non-interactively.

What this error means

The build stalls at a "cpan[1]>" prompt or "Would you like to configure as much as possible automatically? [yes]" with no further output until the step times out.

cpan
CPAN.pm requires configuration, but most of it can be done automatically.
Would you like me to configure as much as possible automatically? [yes]
cpan[1]>

Common causes

CPAN.pm first-run interactive configuration

On a fresh runner, CPAN.pm has no config and prompts for it interactively, which never completes without a TTY.

Module build asking a question with no default answer

Some Makefile.PL/Build.PL scripts prompt for options; without non-interactive defaults, the build waits forever.

How to fix it

Force non-interactive defaults

  1. Export PERL_MM_USE_DEFAULT=1 so prompts take their default answer.
  2. Set PERL_MM_NONINTERACTIVE=1 and use cpanm, which is non-interactive by design.
  3. Avoid the legacy cpan shell in CI.
Terminal
export PERL_MM_USE_DEFAULT=1
export PERL_MM_NONINTERACTIVE=1
cpanm --notest My::Module

Pre-seed CPAN config if you must use cpan

Auto-configure CPAN.pm once with the default answers instead of prompting.

Terminal
yes '' | cpan -T App::cpanminus

How to prevent it

  • Set PERL_MM_USE_DEFAULT=1 for all Perl build steps in CI.
  • Prefer cpanm over the interactive cpan shell.
  • Add a job-level timeout so a hung prompt fails fast instead of burning minutes.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →