M
M
MasterCopipaster2021-03-09 22:09:24
symfony
MasterCopipaster, 2021-03-09 22:09:24

Error The doctrine/orm package is required when the doctrine.orm config is set how to cure?

Installed symfony

symfony new my_project

Install doctrine

composer require doctrine/doctrine-bundle



Using version ^2.2 for doctrine/doctrine-bundle
./composer.json has been updated
Running composer update doctrine/doctrine-bundle
Loading composer repositories with package information
Restricting packages listed in "symfony/symfony" to "5.2.*"
Updating dependencies
Lock file operations: 11 installs, 0 updates, 0 removals
- Locking composer/package-versions-deprecated (1.11.99.1)
- Locking doctrine/annotations (1.12.1)
- Locking doctrine/cache (1.10.2)
- Locking doctrine/collections (1.6.7)
- Locking doctrine/dbal (3.0.0)
- Locking doctrine/doctrine-bundle (2.2.3)
- Locking doctrine/event-manager (1.1.1)
- Locking doctrine/lexer (1.2.1)
- Locking doctrine/persistence (2.1.0)
- Locking doctrine/sql-formatter (1.1.1)
- Locking symfony/doctrine-bridge (v5.2.4)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations : 11 installs, 0 updates, 0 removals
- Installing composer/package-versions-deprecated (1.11.99.1): Extracting archive
- Installing doctrine/lexer (1.2.1): Extracting archive
- Installing doctrine/annotations (1.12.1): Extracting archive
- Installing doctrine/cache (1.10.2): Extracting archive
- Installing doctrine/collections (1.6.7): Extracting archive
- Installing doctrine/event-manager (1.1.1): Extracting archive
- Installing doctrine/persistence (2.1.0): Extracting archive
- Installing symfony/doctrine-bridge (v5.2.4): Extracting archive
- Installing doctrine/sql-formatter (1.1.1): Extracting archive
- Installing doctrine/dbal (3.0 .0): Extracting archive
- Installing doctrine/doctrine-bundle (2.2.3): Extracting archive
Generating optimized autoload files
composer/package-versions-deprecated: Generating version class...
composer/package-versions-deprecated: ... done generating version class
37 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

Symfony operations: 2 recipes (d0cf39cc4589497ee527a9eefa9944a1)
- Configuring doctrine/annotations (>=1.0): From github.com/symfony/recipes:master
- Configuring doctrine/doctrine-bundle (>=2.0): From github.com/symfony/recipes:master
Executing script cache:clear [ KO]
[KO]
Script cache:clear returned with error code 1
!!
!! In Configuration.php line 332:
!!
!! The doctrine/orm package is required when the doctrine.orm config is set.
!!
!!
!!
Script @auto-scripts was called via post-update-cmd

Installation failed, reverting ./composer.json and ./composer.lock to their original content.


All this good life ended - how to cure?
I heard crazy advice that in doctrine.yaml
You need to delete the lines
orm:
auto_generate_proxy_classes: true
naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
auto_mapping: true
mappings:
App:
is_bundle: false
type: annotation
dir: '%kernel.project_dir%/src/Entity'
prefix: 'App\Entity'
alias: App

But this is complete nonsense, because without a nickname, of course, the package will be installed, but it will absolutely not work.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
tukreb, 2021-03-09
@MasterCopipaster

Install symfony/orm-pack it already includes everything you need including doctrine/doctrine-bundle

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question