passbolt/passbolt_api · info
Make sure you have installed psysh as a dependency,
Error message
Make sure you have installed psysh as a dependency,
What it means
Second line of the Psy\Shell guidance printed by ConsoleCommand when psysh is not installed: 'Make sure you have installed psysh as a dependency,'. Purely instructional stderr output explaining the likely cause of the console command failing to start.
Solutions
- Run composer require --dev psy/psysh.
- Regenerate the autoloader (composer dump-autoload) if the package exists but isn't autoloaded.
Defensive patterns
Strategy: fallback
Validate before calling
if (!class_exists('Psy\Shell')) { echo "Install psysh first\n"; } Prevention
- Document psy/psysh as a required dev tool for contributors
- Run composer install after cloning the repo
When it happens
Trigger: `bin/cake passbolt console` executed without psy/psysh present in the autoloader.
Common situations: Fresh checkouts running console before installing suggested dev dependencies; CI containers stripping dev requirements.
Understand the failure class
Background: "not installed", "pip install", "required for": how missing-dependency errors surface across open-source libraries — this error's family across 34 libraries.
Related errors
- and that Psy\Shell is registered in your autoloader.
- Unable to load Psy\Shell.</error>
- If you are using composer run
- $ php composer.phar require psy/psysh</info>
- group(s) returned by your directory are invalid and will be…
AI-assisted analysis of passbolt/passbolt_api@31c1bbc10f (2026-09-17).
Data as JSON: /api/errors/640344ec9273cb21.
Report an issue: GitHub.
Appendix: source
Thrown at src/Command/ConsoleCommand.php:44
/**
* Simple console wrapper around Psy\Shell.
*/
class ConsoleCommand extends Command
{
/**
* Start the Command and interactive console.
*
* @param \Cake\Console\Arguments $args The command arguments.
* @param \Cake\Console\ConsoleIo $io The console io
* @return int|null|void The exit code or null for success
*/
public function execute(Arguments $args, ConsoleIo $io) // phpcs:ignore
{
if (!class_exists('Psy\Shell')) {
$io->err('<error>Unable to load Psy\Shell.</error>');
$io->err('');
$io->err('Make sure you have installed psysh as a dependency,');
$io->err('and that Psy\Shell is registered in your autoloader.');
$io->err('');
$io->err('If you are using composer run');
$io->err('');
$io->err('<info>$ php composer.phar require psy/psysh</info>');
$io->err('');
return static::CODE_ERROR;
}
$io->out('You can exit with <info>`CTRL-C`</info> or <info>`exit`</info>');
$io->out();
Log::drop('debug');
Log::drop('error');
$io->setLoggers(false);
restore_error_handler();
restore_exception_handler();View on GitHub (pinned to 31c1bbc10f)