【发布时间】:2021-04-03 15:52:20
【问题描述】:
我是 symfony 的新手,我尝试通过命令 composer require admin 安装软件包 admin panel,但它给了我错误 The deprecation template must contain the “% service_id%” placeholder,我执行了命令 composer update,并找到了一些答案(更新 easycorp/easyadmin-bundle,更新学说/教义迁移捆绑,更新 symfony/orm-pack)我尝试了这些命令,但它给了我错误:
Fatal error: Declaration of ContainerLTFhDJN\EntityManager_9a5be93::getProxyInitializer() must be compatible with ProxyManager\Proxy\LazyLoadingInterface::getProxyInitializer(): ?Closure in D:
\wamp\www\symfony4\var\cache\dev\ContainerLTFhDJN\srcApp_KernelDevDebugContainer.php on line 5876
Symfony\Component\ErrorHandler\Error\FatalError^ {#33
-error: array:4 [
"type" => 64
"message" => "Declaration of ContainerLTFhDJN\EntityManager_9a5be93::getProxyInitializer() must be compatible with ProxyManager\Proxy\LazyLoadingInterface::getProxyInitializer(): ?Closure"
"file" => "D:\wamp\www\symfony4\var\cache\dev\ContainerLTFhDJN\srcApp_KernelDevDebugContainer.php"
"line" => 5876
]
#message: "Compile Error: Declaration of ContainerLTFhDJN\EntityManager_9a5be93::getProxyInitializer() must be compatible with ProxyManager\Proxy\LazyLoadingInterface::getProxyInitializer():
?Closure"
#code: 0
#file: "D:\wamp\www\symfony4\var\cache\dev\ContainerLTFhDJN\srcApp_KernelDevDebugContainer.php"
#line: 5876
}
【问题讨论】:
-
尝试更新依赖
composer update easycorp/easyadmin-bundle --with-dependencies -
因为看起来即使 composer 命令也失败了,你可以做的是删除包(这不应该使 composer 崩溃),然后只需使用选项
--update-with-dependencies再次要求它。如果仍然失败,请再次删除包并尝试再次要求它,这次使用--update-with-all-dependencies。如果仍然失败,请等待另一个答案或呼叫驱魔人;)