Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Illuminate\Contracts\Container\BindingResolutionException - Target class [CommandMakeCommand] does not exist

Using Laravel 8.75 and trying to upgrade to php 8.1 in composer.json to "php": "^8.1" and receive the error of Illuminate\Contracts\Container\BindingResolutionException - Target class [CommandMakeCommand] does not exist.

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
like image 857
imtryin2code Avatar asked Dec 22 '25 02:12

imtryin2code


1 Answers

i also had same problem, in my case nwidart/laravel-modules package upgraded to 8.3 version, i downgraded to 8.2 version and problem solved

like image 94
Farhad Avatar answered Dec 23 '25 17:12

Farhad