【发布时间】:2022-04-20 19:08:18
【问题描述】:
使用 Laravel 8.75 并尝试将 composer.json 中的 php 8.1 升级到 "php": "^8.1" 并收到 Illuminate\Contracts\Container\BindingResolutionException - Target class [CommandMakeCommand] 的错误不存在。
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 swiftmailer/swiftmailer is abandoned, you should avoid using it.
Use symfony/mailer instead.
Generating optimized autoload files
Illuminate\Foundation\ComposerScripts::postAutoloadDump
@php artisan package:discover --ansi
Illuminate\Contracts\Container\BindingResolutionException
Target class [CommandMakeCommand] does not exist.
at
vendor/laravel/framework/src/Illuminate/Container/Container.php:879
875▕
876▕ try {
877▕ $reflector = new ReflectionClass($concrete);
878▕ } catch (ReflectionException $e) {
879▕ throw new BindingResolutionException("Target class [$concrete] does not exist.", 0, $e);
880▕ }
881▕
882▕ // If the type is not instantiable, the developer is attempting to resolve
883▕ // an abstract type such as an Interface or Abstract Class and there is
+13 vendor frames
14 artisan:37
Illuminate\Foundation\Console\Kernel::handle()
Script @php artisan package:discover --ansi handling the post-autoload-
dump event returned with error code 1
【问题讨论】:
-
您尝试过什么来解决问题?你被困在哪里了?请记住,Laravel 8.75 不是最新版本,所以更新可能已经有所帮助?
标签: php laravel composer-php