执行php webman报错

yulinzhihou

问题描述

截图

在此之前执行了 composer update

在命令行准备打包的时候。
运行 php webman 的时候,报错如下,

php webman 

PHP Fatal error:  Declaration of Webman\Event\EventListCommand::execute(Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output) must be compatible with Symfony\Component\Console\Command\Command::execute(Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output): int in vendor/webman/event/src/EventListCommand.php on line 29

Fatal error: Declaration of Webman\Event\EventListCommand::execute(Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output) must be compatible with Symfony\Component\Console\Command\Command::execute(Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output): int in vendor/webman/event/src/EventListCommand.php on line 29
227 1 0
1个回答

walkor

你的webman/event不是最新的,执行 composer require webman/event 升级下

  • yulinzhihou 2024-02-22

    老大你好,我看了一下,v1.0.5好像是解决了这个问题,但是我直接 composer update 他被锁定了v1.0.4

    yulinzhihou@yulinzhihoudeiMac hands_offline % composer update webman/event
    Loading composer repositories with package information
    Updating dependencies
    Nothing to modify in lock file
    Installing dependencies from lock file (including require-dev)
    Nothing to install, update or remove
    Package paragonie/easyrsa is abandoned, you should avoid using it. Use paragonie/sodium_compat instead.
    Generating autoload files
    30 packages you are using are looking for funding.
    Use the `composer fund` command to find out more!
    No security vulnerability advisories found.
    

    然后执行 composer update webman/event:v1.0.5 或者 composer update 以及删除 composer.lockvender 目录重新 安装,都会是v1.0.4

    yulinzhihou@yulinzhihoudeiMac hands_offline % composer update webman/event:v1.0.5
    Loading composer repositories with package information
    Updating dependencies
    Your requirements could not be resolved to an installable set of packages.
    
      Problem 1
        - Root composer.json requires webman/event ^1.0, found webman/event[v1.0.2, v1.0.3, v1.0.4] but it conflicts with your temporary update constraint (webman/event:v1.0.5).
      Problem 2
        - webman/admin is locked to version v0.6.24 and an update of this package was not requested.
        - webman/admin v0.6.24 requires webman/event ^1.0 -> found webman/event[v1.0.2, v1.0.3, v1.0.4] but it conflicts with your temporary update constraint (webman/event:v1.0.5).
    
    Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
  • walkor 2024-02-22

    可能是你composer代理有问题,去掉composer代理

  • yulinzhihou 2024-02-22

    用的是阿里云的镜像,刚刚把阿里云镜像移除,好像更新到 v1.0.5 可以了。难道是阿里云镜像同步问题?有点玄学。
    感谢老大的指点

  • walkor 2024-02-22

    阿里云镜像2年前就废了

🔝