简体   繁体   中英

JmsSerializerBundle installation ends with error: Unrecognized option “xml” under “jms_serializer.visitors”

When I install a Symfony 4 skeleton project and add the JmsSerializerBundle, I get an error.

To reproduce:

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

The installation ends with an error:

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"

Running composer etc on Windows 10 Powershell. I'm guessing the skeleton is too bare and it needs a dependency, but shouldn't that be solved automatically?

What could be the cause? How can I fix it? Thanks in advance for your help.

The current recipe is not compatible with JMSSerializerBundle 3 (there is a pending pull request, see https://github.com/symfony/recipes-contrib/pull/559 ). So for now, you need to adapt the configuration manually.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM