Install Sonata News Bundle composer error - symfony
i'm trying to use sonata-project/new-bundle.
I start with creating a new fresh symfony 2.8 project.
After i follow, the install guides from the official website
https://sonata-project.org/bundles/news/master/doc/reference/installation.html
I run these commands
composer require sonata-project/news-bundle "dev-master" --no-update
composer require sonata-project/doctrine-orm-admin-bundle "dev-master" --no-update
composer require sonata-project/easy-extends-bundle "dev-master" --no-update
composer require friendsofsymfony/rest-bundle "~1.1" --no-update
composer require nelmio/api-doc-bundle "~0.1|~1.0" --no-update
composer require sonata-project/classification-bundle "~2.2#dev"
but i have these errors in my console :/
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for sonata-project/news-bundle dev-master -> satisfiable by sonata-project/news-bundle[dev-master].
- sonata-project/doctrine-orm-admin-bundle dev-master conflicts with sonata-project/news-bundle[dev-master].
- Installation request for sonata-project/doctrine-orm-admin-bundle dev-master -> satisfiable by sonata-project/doctrine-orm-admin-bundle[dev-master].
Installation failed, reverting ./composer.json to its original content.
What's wrong ?
thanks you for your response.
Using dev-master everywhere is what's wrong. You should never do that. I see that's what is written in the docs, so I'll make a PR to change that, sorry you had to read that.
IMO, your best option is to simply let Composer pick what versions it should use, instead of constraining it :
composer require sonata-project/news-bundle sonata-project/doctrine-orm-admin-bundle sonata-project/easy-extends-bundle friendsofsymfony/rest-bundle nelmio/api-doc-bundle sonata-project/classification-bundle
Using version ^3.0 for sonata-project/news-bundle
Using version ^3.1 for sonata-project/doctrine-orm-admin-bundle
Using version ^2.1 for sonata-project/easy-extends-bundle
Using version ^2.1 for friendsofsymfony/rest-bundle
Using version ^2.13 for nelmio/api-doc-bundle
Using version ^3.1 for sonata-project/classification-bundle
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
This does not work for me though I have this error :
Your requirements could not be resolved to an installable set of packages.
Problem 1
- sonata-project/user-bundle 3.0.1 requires friendsofsymfony/rest-bundle ^1.1 -> satisfiable by friendsofsymfony/rest-bundle[1.1.0, 1.2.0, 1.2.1, 1.2.2, 1.3.0, 1.3.1, 1.4.0, 1.4.0-RC1, 1.4.1, 1.4.2, 1.5.0, 1.5.0-RC1, 1.5.0-RC2, 1.5.0-RC3, 1.5.0-RC4, 1.5.0-RC5, 1.5.1, 1.5.2, 1.5.3, 1.5.x-dev, 1.6.0, 1.6.0-RC1, 1.6.0-RC2, 1.6.1, 1.7.0, 1.7.1, 1.7.2, 1.7.3, 1.7.4, 1.7.6, 1.7.7, 1.7.8, 1.7.9, 1.7.x-dev, 1.8.0, 1.8.0-BETA1, 1.8.0-BETA2, 1.8.x-dev] but these conflict with your requirements or minimum-stability.
- sonata-project/user-bundle 3.0.0 requires friendsofsymfony/rest-bundle ^1.1 -> satisfiable by friendsofsymfony/rest-bundle[1.1.0, 1.2.0, 1.2.1, 1.2.2, 1.3.0, 1.3.1, 1.4.0, 1.4.0-RC1, 1.4.1, 1.4.2, 1.5.0, 1.5.0-RC1, 1.5.0-RC2, 1.5.0-RC3, 1.5.0-RC4, 1.5.0-RC5, 1.5.1, 1.5.2, 1.5.3, 1.5.x-dev, 1.6.0, 1.6.0-RC1, 1.6.0-RC2, 1.6.1, 1.7.0, 1.7.1, 1.7.2, 1.7.3, 1.7.4, 1.7.6, 1.7.7, 1.7.8, 1.7.9, 1.7.x-dev, 1.8.0, 1.8.0-BETA1, 1.8.0-BETA2, 1.8.x-dev] but these conflict with your requirements or minimum-stability.
- Installation request for sonata-project/news-bundle ^3.0 -> satisfiable by sonata-project/news-bundle[3.0.0].
- friendsofsymfony/rest-bundle 2.1.0 conflicts with sonata-project/user-bundle[3.1.0].
- sonata-project/news-bundle 3.0.0 requires sonata-project/user-bundle ^3.0 -> satisfiable by sonata-project/user-bundle[3.0.0, 3.0.1, 3.1.0].
- Installation request for friendsofsymfony/rest-bundle ^2.1 -> satisfiable by friendsofsymfony/rest-bundle[2.1.0].
The doc says "friendsofsymfony/rest-bundle and nelmio/api-doc-bundle are needed only if you use the API." So let's say you don't :
composer require sonata-project/news-bundle sonata-project/doctrine-orm-admin-bundle sonata-project/easy-extends-bundle sonata-project/classification-bundle
Using version ^3.0 for sonata-project/news-bundle
Using version ^3.1 for sonata-project/doctrine-orm-admin-bundle
Using version ^2.1 for sonata-project/easy-extends-bundle
Using version ^3.1 for sonata-project/classification-bundle
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing twig/twig (v1.26.1)
Loading from cache
- Installing symfony/polyfill-mbstring (v1.2.0)
Loading from cache
- Installing psr/log (1.0.2)
Loading from cache
- Installing doctrine/lexer (v1.0.1)
Loading from cache
- Installing doctrine/inflector (v1.1.0)
Loading from cache
- Installing doctrine/collections (v1.3.0)
Loading from cache
- Installing doctrine/cache (v1.6.0)
Loading from cache
- Installing doctrine/annotations (v1.2.7)
Loading from cache
- Installing doctrine/common (v2.6.1)
Loading from cache
- Installing symfony/polyfill-apcu (v1.2.0)
Loading from cache
- Installing symfony/security-acl (v3.0.0)
Loading from cache
- Installing symfony/symfony (v2.8.12)
Downloading: 100%
- Installing symfony/polyfill-php54 (v1.2.0)
Loading from cache
- Installing symfony/polyfill-intl-icu (v1.2.0)
Loading from cache
- Installing symfony/polyfill-util (v1.2.0)
Loading from cache
- Installing paragonie/random_compat (v2.0.3)
Downloading: 100%
- Installing symfony/polyfill-php70 (v1.2.0)
Loading from cache
- Installing symfony/polyfill-php56 (v1.2.0)
Loading from cache
- Installing ircmaxell/password-compat (v1.0.4)
Loading from cache
- Installing symfony/polyfill-php55 (v1.2.0)
Loading from cache
- Installing cocur/slugify (v2.3)
Loading from cache
- Installing sonata-project/core-bundle (3.1.1)
Loading from cache
- Installing sonata-project/datagrid-bundle (2.2)
Loading from cache
- Installing sonata-project/intl-bundle (2.2.4)
Loading from cache
- Installing sonata-project/easy-extends-bundle (2.1.10)
Loading from cache
- Installing sonata-project/cache (1.0.7)
Loading from cache
- Installing sonata-project/block-bundle (3.2.0)
Downloading: 100%
- Installing egeloen/json-builder (2.0.1)
Loading from cache
- Installing egeloen/ckeditor-bundle (4.0.5)
Downloading: 100%
- Installing michelf/php-markdown (1.6.0)
Loading from cache
- Installing knplabs/knp-markdown-bundle (1.5.1)
Loading from cache
- Installing sonata-project/formatter-bundle (3.0.1)
Loading from cache
- Installing twig/extensions (v1.4.0)
Downloading: 100%
- Installing sonata-project/exporter (1.7.0)
Loading from cache
- Installing knplabs/knp-menu (2.2.0)
Downloading: 100%
- Installing knplabs/knp-menu-bundle (2.1.3)
Downloading: 100%
- Installing sonata-project/admin-bundle (3.9.0)
Downloading: 100%
- Installing doctrine/instantiator (1.0.5)
Loading from cache
- Installing doctrine/dbal (v2.5.5)
Loading from cache
- Installing doctrine/orm (v2.5.5)
Loading from cache
- Installing sonata-project/doctrine-orm-admin-bundle (3.1.1)
Downloading: 100%
- Installing sonata-project/classification-bundle (3.1.0)
Loading from cache
- Installing phpoption/phpoption (1.5.0)
Loading from cache
- Installing phpcollection/phpcollection (0.5.0)
Loading from cache
- Installing jms/parser-lib (1.0.0)
Loading from cache
- Installing jms/metadata (1.5.1)
Loading from cache
- Installing jms/serializer (1.3.1)
Loading from cache
- Installing jms/serializer-bundle (1.1.0)
Loading from cache
- Installing kriswallsmith/buzz (v0.15)
Loading from cache
- Installing imagine/imagine (v0.6.3)
Loading from cache
- Installing knplabs/gaufrette (0.2.1)
Loading from cache
- Installing sonata-project/doctrine-extensions (1.0.2)
Loading from cache
- Installing zendframework/zenddiagnostics (v1.0.9)
Loading from cache
- Installing sonata-project/notification-bundle (3.0.0)
Loading from cache
- Installing sonata-project/media-bundle (3.3.0)
Downloading: 100%
- Installing sonata-project/google-authenticator (1.0.2)
Loading from cache
- Installing friendsofsymfony/user-bundle (v1.3.6)
Loading from cache
- Installing sonata-project/user-bundle (3.1.0)
Downloading: 100%
- Installing sonata-project/news-bundle (3.0.0)
Downloading: 100%
paragonie/random_compat suggests installing ext-libsodium (Provides a modern crypto API that can be used to generate random bytes.)
sonata-project/cache suggests installing doctrine/phpcr-odm (PHPCR ODM support)
sonata-project/cache suggests installing ext-memcached (Caching with ext/memcached)
sonata-project/cache suggests installing predis/predis (Install redis php)
sonata-project/block-bundle suggests installing sonata-project/cache-bundle (^3.0)
egeloen/ckeditor-bundle suggests installing egeloen/form-extra-bundle (Allows to load CKEditor asynchronously)
knplabs/knp-markdown-bundle suggests installing ext-sundown (to use optional support for php-sundown extension instead of php implementation)
sonata-project/exporter suggests installing propel/propel1 (^1.6)
knplabs/knp-menu suggests installing pimple/pimple (for the built-in implementations of the menu provider and renderer provider)
knplabs/knp-menu suggests installing silex/silex (for the integration with your silex application)
sonata-project/admin-bundle suggests installing jms/di-extra-bundle (Annotations for Admin definition)
sonata-project/admin-bundle suggests installing jms/translation-bundle (Extract message keys from Admins)
sonata-project/admin-bundle suggests installing sensio/generator-bundle (Add sonata:admin:generate command)
sonata-project/doctrine-orm-admin-bundle suggests installing simplethings/entity-audit-bundle (If you want to support for versioning of entities and their associations.)
jms/serializer-bundle suggests installing jms/di-extra-bundle (Required to get lazy loading (de)serialization visitors, ~1.3)
imagine/imagine suggests installing ext-imagick (to use the Imagick implementation)
imagine/imagine suggests installing ext-gmagick (to use the Gmagick implementation)
knplabs/gaufrette suggests installing amazonwebservices/aws-sdk-for-php (to use the legacy Amazon S3 adapters)
knplabs/gaufrette suggests installing aws/aws-sdk-php (to use the Amazon S3 adapter)
knplabs/gaufrette suggests installing dropbox-php/dropbox-php (to use the Dropbox adapter)
knplabs/gaufrette suggests installing google/apiclient (to use GoogleCloudStorage adapter)
knplabs/gaufrette suggests installing herzult/php-ssh (to use SFtp adapter)
knplabs/gaufrette suggests installing knplabs/knp-gaufrette-bundle (to use with Symfony2)
knplabs/gaufrette suggests installing microsoft/windowsazure (to use Microsoft Azure Blob Storage adapter)
knplabs/gaufrette suggests installing phpseclib/phpseclib (to use PhpseclibSftp adapter)
knplabs/gaufrette suggests installing rackspace/php-opencloud (to use Opencloud adapter)
zendframework/zenddiagnostics suggests installing sensiolabs/security-checker (Required by Check\SecurityAdvisory)
zendframework/zenddiagnostics suggests installing guzzle/http (Required by Check\GuzzleHttpService)
zendframework/zenddiagnostics suggests installing predis/predis (Required by Check\Redis)
zendframework/zenddiagnostics suggests installing videlalvaro/php-amqplib (Required by Check\RabbitMQ)
zendframework/zenddiagnostics suggests installing doctrine/migrations (Required by Check\DoctrineMigration)
sonata-project/notification-bundle suggests installing guzzle/guzzle (^3.9)
sonata-project/notification-bundle suggests installing liip/monitor-bundle (^1.0)
sonata-project/notification-bundle suggests installing videlalvaro/php-amqplib (^2.0)
sonata-project/media-bundle suggests installing liip/imagine-bundle (^0.9)
sonata-project/media-bundle suggests installing rackspace/php-opencloud (^1.6)
sonata-project/media-bundle suggests installing sonata-project/seo-bundle (^2.0)
sonata-project/media-bundle suggests installing tilleuls/ckeditor-sonata-media-bundle (^1.0)
friendsofsymfony/user-bundle suggests installing willdurand/propel-typehintable-behavior (Needed when using the propel implementation)
sonata-project/user-bundle suggests installing friendsofsymfony/rest-bundle (For using the public API methods.)
sonata-project/user-bundle suggests installing nelmio/api-doc-bundle (For using the public API methods.)
sonata-project/user-bundle suggests installing sonata-project/seo-bundle (For SEO breadcrumb block service usage)
Writing lock file
Generating autoload files
classification and easy extends are already auto-required by the bundle, so you just actually need to do this : composer require sonata-project/news-bundle sonata-project/doctrine-orm-admin-bundle
UPDATE: here is my PR
Related
Symfony 5 : install smalot/cups-ipp with composer
I'm trying to install smalot/cups-ipp package on Symfony 5 but I have dependency issue with required packages. To install smalot/cups-ipp, I run following command: # composer require smalot/cups-ipp:dev-master And result is: Do not run Composer as root/super user! See https://getcomposer.org/root for details ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Restricting packages listed in "symfony/symfony" to "5.0.*" Your requirements could not be resolved to an installable set of packages. Problem 1 - Installation request for smalot/cups-ipp dev-master -> satisfiable by smalot/cups-ipp[dev-master]. - smalot/cups-ipp dev-master requires php-http/socket-client ^1.0 -> satisfiable by php-http/socket-client[v1.0.0, v1.1.0, v1.2.0, v1.3.0, v1.4.0, v1.4.1] but these conflict with your requirements or minimum-stability. Installation failed, reverting ./composer.json to its original content. I tried normal version (not dev-master) but I got another dependency issue with symfony/yaml package. I installed php-http/socket-client which requires symfony/options-resolver. symfony/options-resolver is in version 5 for Symfony 5. So I installed php-http/socket-client in dev-master version otherwise I have another dependency issue. So now I have: # composer show -i symfony/options-resolver v5.0.8 php-http/socket-client dev-master My problem is that smalot/cups-ipp requires php-http/socket-client in version 1.4, not version 2.0. So do you know how I can force smalot/cups-ipp installation with current php-http/socket-client package which is in dev-master (2.0) version?
As you can see on https://github.com/smalot/cups-ipp/releases, there has been a release of that package just today. This update eases all package restrictions. It is not yet available on Packagist, that's something that the maintainer must either configure through auto updates or trigger manually - until then, you have to wait.
installing fos/elasticabundle, it need pagerfanta version
I want install FOSElasticaBundle, but erorr occured. I don't know what to do, system cmd shows this: C:\xampp\htdocs\project>composer require friendsofsymfony/elastica-bundle Using version ^5.0 for friendsofsymfony/elastica-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.*" Your requirements could not be resolved to an installable set of packages. Problem 1 - Conclusion: don't install friendsofsymfony/elastica-bundle v5.0.3 - Conclusion: don't install friendsofsymfony/elastica-bundle v5.0.2 - Conclusion: don't install friendsofsymfony/elastica-bundle v5.0.1 - Conclusion: remove pagerfanta/pagerfanta v2.0.1 - Installation request for friendsofsymfony/elastica-bundle ^5.0 -> satisfiable by friendsofsymfony/elastica-bundle[v5.0.0, v5.0.1, v5.0.2, v5.0.3]. - Conclusion: don't install pagerfanta/pagerfanta v2.0.1 - friendsofsymfony/elastica-bundle v5.0.0 requires pagerfanta/pagerfanta ^1.0.5 -> satisfiable by pagerfanta/pagerfanta[v1.0.5, v1.1.0]. - Can only install one of: pagerfanta/pagerfanta[v1.1.0, v2.0.1]. - Can only install one of: pagerfanta/pagerfanta[v1.0.5, v2.0.1]. - Installation request for pagerfanta/pagerfanta (locked at v2.0.1) -> satis fiable by pagerfanta/pagerfanta[v2.0.1]. Installation failed, reverting ./composer.json to its original content. C:\xampp\htdocs\project> I have pagerfanta installed but it works good. Please help.
friendsofsymfony/elastica-bundle v5.0.0 requires pagerfanta/pagerfanta ^1.0.5 -> satisfiable by pagerfanta/pagerfanta[v1.0.5, v1.1.0]. You have pagerfanta/pagerfanta v2.0.1 installed, so to use elastica-bundle v5.0.3 you need to downgrade it to v1.1.0
Drupal - error installing module "entity"
I have a Drupal installation within a Docker container, with Composer and Drush installed. I'd like to install the Entity-API module (https://www.drupal.org/project/entity), and I start off with: composer require drupal/entity This gives me an error: Using version ^0.1.0 for drupal/entity ./composer.json has been updated > DrupalProject\composer\ScriptHandler::checkComposerVersion Loading composer repositories with package information Updating dependencies (including require-dev) Your requirements could not be resolved to an installable set of packages. Problem 1 - Can only install one of: drupal/core[8.5.6, 8.0.x-dev]. - Can only install one of: drupal/core[8.0.x-dev, 8.5.6]. - Can only install one of: drupal/core[8.0.x-dev, 8.5.6]. - drupal/entity 0.1.0 requires drupal/core <8.1.0 -> satisfiable by drupal/core[8.0.x-dev]. - Installation request for drupal/entity ^0.1.0 -> satisfiable by drupal/entity[0.1.0]. - Installation request for drupal/core (locked at 8.5.6, required as ~8.5.3) -> satisfiable by drupal/core[8.5.6]. Installation failed, reverting ./composer.json to its original content. My Drupal version is 8.5.6 and I'm using the latest version of Composer, installed from https://getcomposer.org/installer How would I get this installed using Composer? Tx
Use --update-with-all-dependencies switch: composer require drupal/entity --update-with-all-dependencies --update-with-all-dependencies: Also update dependencies of the newly required packages, including those that are root requirements. https://getcomposer.org/doc/03-cli.md#require
Composer create-project symfony/skeleton new_project "4.0"
It installs: Symfony 4.1.3 (kernel: src, env: dev, debug: true) How do I get it to install exactly 4.0.*? composer create-project symfony/skeleton new_project "4.0" Installing symfony/skeleton (v4.0.0) - Installing symfony/skeleton (v4.0.0): Loading from cache Created project in aaaa Loading composer repositories with package information Updating dependencies (including require-dev) Package operations: 22 installs, 0 updates, 0 removals - Installing symfony/flex (v1.0.89): Loading from cache - Installing symfony/polyfill-mbstring (v1.9.0): Loading from cache - Installing symfony/console (v4.1.3): Loading from cache - Installing symfony/routing (v4.1.3): Loading from cache - Installing symfony/polyfill-ctype (v1.9.0): Loading from cache - Installing symfony/http-foundation (v4.1.3): Loading from cache - Installing symfony/event-dispatcher (v4.1.3): Loading from cache - Installing psr/log (1.0.2): Loading from cache - Installing symfony/debug (v4.1.3): Loading from cache - Installing symfony/http-kernel (v4.1.3): Loading from cache - Installing symfony/finder (v4.1.3): Loading from cache - Installing symfony/filesystem (v4.1.3): Loading from cache - Installing psr/container (1.0.0): Loading from cache - Installing symfony/dependency-injection (v4.1.3): Loading from cache - Installing symfony/config (v4.1.3): Loading from cache - Installing psr/simple-cache (1.0.1): Loading from cache - Installing psr/cache (1.0.1): Loading from cache - Installing symfony/cache (v4.1.3): Loading from cache - Installing symfony/framework-bundle (v4.1.3): Loading from cache - Installing symfony/yaml (v4.1.3): Loading from cache - Installing symfony/dotenv (v4.1.3): Loading from cache Writing lock file Generating autoload files Symfony operations: 4 recipes (df8c84407bbee5e3e826455e7bbdef65) - Configuring symfony/flex (>=1.0): From github.com/symfony/recipes:master - Configuring symfony/framework-bundle (>=3.3): From github.com/symfony/recipes:master - Configuring symfony/console (>=3.3): From github.com/symfony/recipes:master - Configuring symfony/routing (>=4.0): From github.com/symfony/recipes:master Executing script cache:clear [OK] Executing script assets:install public [OK]
Try it this way: composer create-project symfony/skeleton new_project 4.0.* More info in composer documentation - https://getcomposer.org/doc/03-cli.md#create-project Also, Symfony 4.0.* is no longer maintained. Consider upgrading to 4.1
Just installing as it is: composer create-project symfony/skeleton new_project 4.0 it will install 4.1.3 and then changing in composer.json symfony/framework-bundle to "~4.0.0" and then composer update
Updating Symfony 2 fails with error due to symfony/finder
Performed a standard installation of Symfony and attempted to update using composer update which gives the following error: Loading composer repositories with package information Updating dependencies (including require-dev) Your requirements could not be resolved to an installable set of packages. Problem 1 - symfony/framework-bundle v2.7.9 requires symfony/finder ~2.0,>=2.0.5 -> no matching package found. - symfony/framework-bundle v2.7.8 requires symfony/finder ~2.0,>=2.0.5 -> no matching package found. - symfony/framework-bundle v2.7.10 requires symfony/finder ~2.0,>=2.0.5 -> no matching package found. - symfony/framework-bundle v2.3.38 requires symfony/finder ~2.0,>=2.0.5 -> no matching package found. - symfony/framework-bundle v2.3.37 requires symfony/finder ~2.0,>=2.0.5 -> no matching package found. - symfony/framework-bundle v2.3.36 requires symfony/finder ~2.0,>=2.0.5 -> no matching package found. - Conclusion: remove symfony/symfony v3.0.3 - Conclusion: don't install symfony/symfony v3.0.3 I am unable to add any further libraries as the standard update already fails. Any help is appreciated!
I can't reproduce your bug - update works ok on fresh symfony-standard project This is result of composer update just after calling composer create-project symfony/framework-standard-edition Loading composer repositories with package information Updating dependencies (including require-dev) - Removing monolog/monolog (1.17.2) - Installing monolog/monolog (1.18.0) Downloading: 100% - Removing paragonie/random_compat (v1.2.0) - Installing paragonie/random_compat (v1.2.1) Downloading: 100% - Removing symfony/monolog-bundle (v2.8.2) - Installing symfony/monolog-bundle (v2.9.0) Downloading: 100% - Removing sensio/framework-extra-bundle (v3.0.13) - Installing sensio/framework-extra-bundle (v3.0.14) Downloading: 100% Writing lock file Generating autoload files What You can do? Try to clear your composer cache composer clear-cache