I'm trying to install api-platform but I'm having problems after launching my composer install:
I follow the official docs for installation with:
composer req api
When I start the server or when I try to run composer install
I get this error:
Executing script cache:clear [KO]
[KO]
Script cache:clear returned with error code 255
and then a warning:
[WARNING] Some commands could not be registered:
!!
!!
!! In DoctrineOrmPropertyMetadataFactory.php line 31:
!!
!! Argument 1 passed to ApiPlatform\Core\Bridge\Doctrine\Orm\Metadata\Property
!! \DoctrineOrmPropertyMetadataFactory::__construct() must be an instance of D
!! octrine\Common\Persistence\ManagerRegistry, instance of Doctrine\Bundle\Doc
!! trineBundle\Registry given, called in /var/www/test-api-sf/var/cache/dev/Co
!! ntainerPA69O1T/App_KernelDevDebugContainer.php on line 1040
!!
!!
!! In DoctrineOrmPropertyMetadataFactory.php line 31:
!!
!! Argument 1 passed to ApiPlatform\Core\Bridge\Doctrine\Orm\Metadata\Property
!! \DoctrineOrmPropertyMetadataFactory::__construct() must be an instance of D
!! octrine\Common\Persistence\ManagerRegistry, instance of Doctrine\Bundle\Doc
!! trineBundle\Registry given, called in /var/www/test-api-sf/var/cache/dev/Co
!! ntainerPA69O1T/App_KernelDevDebugContainer.php on line 1040
!!
!!
!! [WARNING] Some commands could not be registered:
!!
!!
!! In DoctrineOrmPropertyMetadataFactory.php line 31:
!!
!! Argument 1 passed to ApiPlatform\Core\Bridge\Doctrine\Orm\Metadata\Property
!! \DoctrineOrmPropertyMetadataFactory::__construct() must be an instance of D
!! octrine\Common\Persistence\ManagerRegistry, instance of Doctrine\Bundle\Doc
!! trineBundle\Registry given, called in /var/www/test-api-sf/var/cache/dev/Co
!! ntainerPA69O1T/App_KernelDevDebugContainer.php on line 1040
!!
!!
!! In DoctrineOrmPropertyMetadataFactory.php line 31:
!!
!! Argument 1 passed to ApiPlatform\Core\Bridge\Doctrine\Orm\Metadata\Property
!! \DoctrineOrmPropertyMetadataFactory::__construct() must be an instance of D
!! octrine\Common\Persistence\ManagerRegistry, instance of Doctrine\Bundle\Doc
!! trineBundle\Registry given, called in /var/www/test-api-sf/var/cache/dev/Co
!! ntainerPA69O1T/App_KernelDevDebugContainer.php on line 1040
!!
!!
!! // Clearing the cache for the dev environment with debug
!! // true
!!
!!
!! In DoctrineOrmPropertyMetadataFactory.php line 31:
!!
!! Argument 1 passed to ApiPlatform\Core\Bridge\Doctrine\Orm\Metadata\Property
!! \DoctrineOrmPropertyMetadataFactory::__construct() must be an instance of D
!! octrine\Common\Persistence\ManagerRegistry, instance of Doctrine\Bundle\Doc
!! trineBundle\Registry given, called in /var/www/test-api-sf/var/cache/dev/Co
!! ntainerPA69O1T/App_KernelDevDebugContainer.php on line 1040
!!
!!
!! cache:clear [--no-warmup] [--no-optional-warmers] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command>
!!
!! 2020-08-25T12:06:30+02:00 [critical] Uncaught Error: Argument 1 passed to ApiPlatform\Core\Bridge\Doctrine\Orm\Metadata\Property\DoctrineOrmPropertyMetadataFactory::__construct() must be an instance of Doctrine\Common\Persistence\ManagerRegistry, instance of Doctrine\Bundle\DoctrineBundle\Registry given, called in /var/www/test-api-sf/var/cache/dev/ContainerPA69O1T/App_KernelDevDebugContainer.php on line 1040
Why am I getting this error, and what can I do to circumvent it?