php - 脚本@php artisan package :discover --ansi handling the post-autoload-dump event returned with error code 1

标签 php laravel laravel-5 composer-php laravel-5.6

我在 laravel 项目中更新 Composer 时遇到错误。我正在使用 Laravel 5.6。

更新 composer 时获取 Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1。我尝试了很多解决方案但没有任何反应,错误仍然存​​在。

Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi

   Illuminate\Database\QueryException  : SQLSTATE[42S02]: Base table or view not found: 1146 Table 'xyz.x' doesn't exist (SQL: select * from `x`)

  at /erp/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664
    660|         // If an exception occurs when attempting to run a query, we'll format the error
    661|         // message to include the bindings with SQL, which will make this exception a
    662|         // lot more helpful to the developer instead of just the database's errors.
    663|         catch (Exception $e) {
  > 664|             throw new QueryException(
    665|                 $query, $this->prepareBindings($bindings), $e
    666|             );
    667|         }
    668|

  Exception trace:

  1   App\Services\Listing\CompositionChecker::__construct()
      [internal]:0

  2   PDOException::("SQLSTATE[42S02]: Base table or view not found: 1146 Table 'xyz.x' doesn't exist")
      /erp/vendor/laravel/framework/src/Illuminate/Database/Connection.php:326

  Please use the argument -v to see more details.
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1

如何解决?提前致谢。

最佳答案

从 Laravel 应用程序的根目录中删除 bootstrap/cache 目录中的所有文件帮助我解决了这个问题。

关于php - 脚本@php artisan package :discover --ansi handling the post-autoload-dump event returned with error code 1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59622383/

相关文章:

php - 无法在智能手机中获取文件的 tmp_name ($_FILES)

PHP警告: mysqli_fetch_object() expects parameter 1 to be mysqli_result,

php - 如何在AJAX中显示MYSQL错误?

Laravel Eloquent - 使用 "With"和 "find"

javascript - 使用 VueJS 将 JSON 对象显示到表中

php - MysqL:对多列执行全文搜索并100%匹配

mysql - 连接到 MySql 远程服务器 |拒绝访问

laravel - Eloquent `update()` 方法也更新脏列

php - android手机通过端口访问laravel server

php - 如何计算多维物体? (php)