JmsSerializerBundle的安装以错误结束:“ jms_serializer.visitors”下的无法识别的选项“ xml”

时间:2018-11-22 10:47:13

标签: php composer-php symfony4 jmsserializerbundle

当我安装Symfony 4骨架项目并添加JmsSerializerBundle时,出现错误。

要复制:

composer create-project symfony/website-skeleton myproject
cd myproject
composer require jms/serializer-bundle

安装结束并显示错误:

Using version ^3.0 for jms/serializer-bundle
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Restricting packages listed in "symfony/symfony" to "4.1.*"
Package operations: 16 installs, 0 updates, 0 removals
  - Installing hoa/exception (1.17.01.16): Loading from cache
  - Installing hoa/event (1.17.01.13): Loading from cache
  - Installing hoa/consistency (1.17.05.02): Loading from cache
  - Installing hoa/visitor (2.17.01.16): Loading from cache
  - Installing hoa/ustring (4.17.01.16): Loading from cache
  - Installing hoa/protocol (1.17.01.14): Loading from cache
  - Installing hoa/zformat (1.17.01.10): Loading from cache
  - Installing hoa/iterator (2.17.01.10): Loading from cache
  - Installing hoa/compiler (3.17.08.08): Loading from cache
  - Installing hoa/regex (1.17.01.13): Loading from cache
  - Installing hoa/math (1.17.05.16): Loading from cache
  - Installing hoa/stream (1.17.02.21): Loading from cache
  - Installing hoa/file (1.17.07.11): Loading from cache
  - Installing jms/metadata (2.0.0): Loading from cache
  - Installing jms/serializer (2.0.0): Loading from cache
  - Installing jms/serializer-bundle (3.0.0): Loading from cache
Writing lock file
Generating autoload files
ocramius/package-versions:  Generating version class...
ocramius/package-versions: ...done generating version class
Symfony operations: 1 recipe (f702450e5b1b913f83ea887faacbdb83)
  -  WARNING  jms/serializer-bundle (>=2.0): From github.com/symfony/recipes-contrib:master
    The recipe for this package comes from the "contrib" repository, which is open to community contributions.
    Review the recipe at https://github.com/symfony/recipes-contrib/tree/master/jms/serializer-bundle/2.0

    Do you want to execute this recipe?
    [y] Yes
    [n] No
    [a] Yes for all packages, only for the current installation session
    [p] Yes permanently, never ask again for this project
    (defaults to n): y
  - Configuring jms/serializer-bundle (>=2.0): From github.com/symfony/recipes-contrib:master
Executing script cache:clear [KO]
 [KO]
Script cache:clear returned with error code 1
!!
!!  In ArrayNode.php line 304:
!!
!!    Unrecognized option "xml" under "jms_serializer.visitors"

在Windows 10 Powershell上运行作曲家等。我猜骨架太裸了,它需要依赖,但这不是应该自动解决吗?

可能是什么原因?我该如何解决?预先感谢您的帮助。

1 个答案:

答案 0 :(得分:1)

当前配方与JMSSerializerBundle 3不兼容(存在挂起的拉取请求,请参见https://github.com/symfony/recipes-contrib/pull/559)。因此,现在,您需要手动调整配置。