首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >用Composer和Symfony解决255错误的方法

用Composer和Symfony解决255错误的方法
EN

Stack Overflow用户
提问于 2021-04-20 13:38:20
回答 1查看 1.3K关注 0票数 0

我对Composer有一个问题,当我运行composer install命令时,会出现一个错误255。

以下是我为解决这一问题所做的工作:

  • I更新了编写器,错误出现在版本1和 synfony 5
    • 更新的PC

    中。

我正在运行Ubuntu 20.04。

错误细节:

代码语言:javascript
复制
Don't forget to run npm install --force or yarn install --force to refresh your JavaScript dependencies!
Run composer recipes at any time to see the status of your Symfony recipes.

Executing script cache:clear [KO]
 [KO]
Script cache:clear returned with error code 255
!!  PHP Fatal error:  Declaration of Symfony\Component\DependencyInjection\ServiceLocator::has(string $id) must be compatible with Psr\Container\ContainerInterface::has($id) in /home/massi/Projets/projet-RH/vendor/symfony/dependency-injection/ServiceLocator.php on line 46
!!  Symfony\Component\ErrorHandler\Error\FatalError {#92
!!    -error: array:4 [
!!      "type" => 64
!!      "message" => "Declaration of Symfony\Component\DependencyInjection\ServiceLocator::has(string $id) must be compatible with Psr\Container\ContainerInterface::has($id)"
!!      "file" => "/home/massi/Projets/projet-RH/vendor/symfony/dependency-injection/ServiceLocator.php"
!!      "line" => 46
!!    ]
!!    #message: "Compile Error: Declaration of Symfony\Component\DependencyInjection\ServiceLocator::has(string $id) must be compatible with Psr\Container\ContainerInterface::has($id)"
!!    #code: 0
!!    #file: "./vendor/symfony/dependency-injection/ServiceLocator.php"
!!    #line: 46
!!  }
!!  
Script @auto-scripts was called via post-install-cmd
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-04-20 13:54:41

这是最近更新的一个软件包的一个问题

composer require symfony/service-contracts:2.2.0

:)

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67180108

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档