【问题标题】:Laravel Tinker Error: Symfony\Component\Debug\Exception\FatalThrowableError : Call to undefined method Psy\Configuration::getLoop()Laravel Tinker 错误:Symfony\Component\Debug\Exception\FatalThrowableError:调用未定义的方法 Psy\Configuration::getLoop()
【发布时间】:2019-10-02 07:11:57
【问题描述】:

我正在尝试在我的项目上运行 php artisan tinker 并收到此错误:

Symfony\Component\Debug\Exception\FatalThrowableError  : Call to undefined method Psy\Configuration::getLoop()

  at /var/www/[my_project]/vendor/psy/psysh/src/Psy/Shell.php:80
    76|     public function __construct(Configuration $config = null)
    77|     {
    78|         $this->config   = $config ?: new Configuration();
    79|         $this->cleaner  = $this->config->getCodeCleaner();
  > 80|         $this->loop     = $this->config->getLoop();
    81|         $this->context  = new Context();
    82|         $this->includes = array();
    83|         $this->readline = $this->config->getReadline();
    84|         $this->inputBuffer = array();

如您所见,问题出在 80 行。 我想我必须提到,我曾经在我的一个控制器中使用ThrowableFatalThrowableError 来获得Exception,因为一般Exception 无法获得我得到的Exception!我以另一种方式处理了那个可抛出的错误,并且能够通过Exception 自己获得那个Exception!无论如何,我没有在我的代码中的任何地方使用ThrowableFatalThrowableError,但我仍然收到上述错误。

我怎样才能让php artisan tinker 再次工作?我认为这个问题与composer有关。

【问题讨论】:

    标签: php laravel symfony tinker


    【解决方案1】:

    我刚刚手动删除了我的vendor 文件夹,并尝试运行composer install。通过这样做,php artisan tinker 命令再次正常工作。 这可能不是正确的解决方案,但无论如何,它再次起作用。也许只是删除 vendor/psy 文件夹并运行 composer install 会做同样的事情。

    【讨论】:

      猜你喜欢
      • 2019-08-02
      • 2020-05-15
      • 2018-08-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-08-21
      • 2019-01-04
      • 1970-01-01
      相关资源
      最近更新 更多