Reputation: 13
When I do a composer update on my symfony 3.4.30 installation, it completes without problem, but when I try running composer install on the created lock file, it throws an error.
This happens both on my CentOS server, and my MacOS laptop. I have the latest composer installed:
Anyone know what is going on?
I have tried completely removing the vendor directory, and the composer.lock file with no success. I have also updated my composer version, and also cleared my composer cache:
composer clearcache
Cache directory does not exist (cache-vcs-dir):
Clearing cache (cache-repo-dir): /home/<user>/.composer/cache/repo
Clearing cache (cache-files-dir): /home/<user>/.composer/cache/files
Clearing cache (cache-dir): /home/<user>/.composer/cache
All caches cleared.
composer --version
Composer version 1.9.0 2019-08-02 20:55:32
php -dmemory_limit=-1 /usr/bin/composer.phar update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 63 installs, 0 updates, 0 removals
- Installing doctrine/cache (v1.8.0): Downloading (100%)
- Installing doctrine/inflector (v1.3.0): Downloading (100%)
- Installing paragonie/random_compat (v2.0.18): Downloading (100%)
- Installing symfony/polyfill-php70 (v1.12.0): Downloading (100%)
- Installing symfony/polyfill-util (v1.12.0): Downloading (100%)
- Installing symfony/polyfill-php56 (v1.12.0): Downloading (100%)
- Installing symfony/polyfill-mbstring (v1.12.0): Downloading (100%)
- Installing symfony/symfony (v3.4.30): Downloading (100%)
- Installing symfony/polyfill-intl-icu (v1.12.0): Downloading (100%)
- Installing symfony/polyfill-ctype (v1.12.0): Downloading (100%)
- Installing symfony/polyfill-apcu (v1.12.0): Downloading (100%)
- Installing psr/simple-cache (1.0.1): Downloading (100%)
- Installing psr/log (1.1.0): Downloading (100%)
- Installing psr/link (1.0.0): Downloading (100%)
- Installing psr/container (1.0.0): Downloading (100%)
- Installing psr/cache (1.0.1): Downloading (100%)
- Installing twig/twig (v2.11.3): Downloading (100%)
- Installing fig/link-util (1.0.0): Downloading (100%)
- Installing doctrine/lexer (1.0.2): Downloading (100%)
- Installing doctrine/annotations (v1.7.0): Downloading (100%)
- Installing doctrine/reflection (v1.0.0): Downloading (100%)
- Installing doctrine/event-manager (v1.0.0): Downloading (100%)
- Installing doctrine/collections (v1.6.2): Downloading (100%)
- Installing doctrine/persistence (1.1.1): Downloading (100%)
- Installing doctrine/common (v2.10.0): Downloading (100%)
- Installing doctrine/doctrine-cache-bundle (1.3.5): Downloading (100%)
- Installing symfony/polyfill-php73 (v1.12.0): Downloading (100%)
- Installing symfony/polyfill-php72 (v1.12.0): Downloading (100%)
- Installing symfony/polyfill-intl-idn (v1.12.0): Downloading (100%)
- Installing symfony/mime (v4.3.3): Downloading (100%)
- Installing jdorn/sql-formatter (v1.2.17): Downloading (100%)
- Installing doctrine/dbal (v2.9.2): Downloading (100%)
- Installing doctrine/doctrine-bundle (1.11.2): Downloading (100%)
- Installing symfony/templating (v4.3.3): Downloading (100%)
- Installing friendsofsymfony/user-bundle (v2.1.2): Downloading (100%)
- Installing incenteev/composer-parameter-handler (v2.1.3): Downloading (100%)
- Installing symfony/http-client-contracts (v1.1.5): Downloading (100%)
- Installing symfony/http-client (v4.3.3): Downloading (100%)
- Installing sensiolabs/security-checker (v6.0.2): Downloading (100%)
- Installing sensio/distribution-bundle (v5.0.25): Downloading (100%)
- Installing sensio/framework-extra-bundle (v5.4.1): Downloading (100%)
- Installing monolog/monolog (1.24.0): Downloading (100%)
- Installing symfony/monolog-bundle (v3.4.0): Downloading (100%)
- Installing swiftmailer/swiftmailer (v5.4.12): Downloading (100%)
- Installing symfony/swiftmailer-bundle (v2.6.7): Downloading (100%)
- Installing guzzlehttp/promises (v1.3.1): Downloading (100%)
- Installing ralouphie/getallheaders (3.0.3): Downloading (100%)
- Installing psr/http-message (1.0.1): Downloading (100%)
- Installing guzzlehttp/psr7 (1.6.1): Downloading (100%)
- Installing guzzlehttp/guzzle (6.3.3): Downloading (100%)
- Installing sendgrid/php-http-client (3.9.6): Downloading (100%)
- Installing sendgrid/sendgrid (7.3.0): Downloading (100%)
- Installing google/recaptcha (1.2.2): Downloading (100%)
- Installing excelwebzone/recaptcha-bundle (v1.5.15): Downloading (100%)
- Installing sensio/generator-bundle (v3.1.7): Downloading (100%)
- Installing symfony/phpunit-bridge (v3.4.30): Downloading (100%)
- Installing fzaninotto/faker (v1.8.0): Downloading (100%)
- Installing hamcrest/hamcrest-php (v2.0.0): Downloading (100%)
- Installing mockery/mockery (1.2.3): Downloading (100%)
- Installing doctrine/instantiator (1.2.0): Downloading (100%)
- Installing doctrine/orm (v2.6.3): Downloading (100%)
- Installing steevanb/doctrine-stats (1.3.3): Downloading (100%)
- Installing steevanb/php-backtrace (2.0.1): Downloading (100%
Writing lock file
Generating autoload files
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache
composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Conclusion: remove friendsofsymfony/user-bundle v2.1.2
- Installation request for friendsofsymfony/user-bundle v2.1.2 -> satisfiable by friendsofsymfony/user-bundle[v2.1.2].
- Conclusion: remove symfony/symfony v3.4.30
- friendsofsymfony/user-bundle v2.1.2 requires symfony/templating ^2.8 || ^3.0 || ^4.0 -> satisfiable by symfony/templating[v4.3.3].
- don't install symfony/symfony v3.4.30|remove symfony/templating v4.3.3
- don't install symfony/templating v4.3.3|don't install symfony/symfony v3.4.30
- Installation request for symfony/symfony v3.4.30 -> satisfiable by symfony/symfony[v3.4.30].
Here is my composer.json:
{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-4": {
"AppBundle\\": "src/AppBundle"
},
"classmap": [
"app/AppKernel.php",
"app/AppCache.php"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
},
"files": [
"vendor/symfony/symfony/src/Symfony/Component/VarDumper/Resources/functions/dump.php"
]
},
"require": {
"php": ">=7.1.18",
"doctrine/doctrine-bundle": "^1.6",
"doctrine/orm": "^2.5",
"friendsofsymfony/user-bundle": "^2.0",
"incenteev/composer-parameter-handler": "^2.0",
"sensio/distribution-bundle": "^5.0.19",
"sensio/framework-extra-bundle": "^5.0.0",
"symfony/monolog-bundle": "^3.1.0",
"symfony/polyfill-apcu": "^1.0",
"symfony/swiftmailer-bundle": "^2.6.4",
"symfony/symfony": "^3.0",
"twig/twig": "^1.0||^2.0",
"guzzlehttp/guzzle": "^6.3",
"symfony/templating": "^4.1",
"sendgrid/sendgrid": "~7",
"excelwebzone/recaptcha-bundle": "~1.5",
"paragonie/random_compat": "^2.0"
},
"require-dev": {
"sensio/generator-bundle": "^3.0",
"symfony/phpunit-bridge": "^3.0",
"fzaninotto/faker": "~1.2",
"mockery/mockery": "~1.1",
"steevanb/doctrine-stats": "^1.3",
"steevanb/php-backtrace": "^2.0"
},
"scripts": {
"symfony-scripts": [
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
],
"post-install-cmd": [
"@symfony-scripts"
],
"post-update-cmd": [
"@symfony-scripts"
]
},
"config": {
"platform": {
"php": "7.1.18"
},
"sort-packages": true
},
"extra": {
"symfony-app-dir": "app",
"symfony-bin-dir": "bin",
"symfony-var-dir": "var",
"symfony-web-dir": "web",
"symfony-tests-dir": "tests",
"symfony-assets-install": "relative",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"branch-alias": {
"dev-master": "3.4-dev"
}
}
}
Upvotes: 1
Views: 8646
Reputation: 39109
Your way to fix it is to drop the line
"symfony/templating": "^4.1",
From your composer.json
, and retry the whole thing.
Mind that it will downgrade your symfony/templating
version to 3.4.x
and might cause you side effects.
Why? Well, your issue is actually coming from here: that line of the composer.json of symfony/symfony: https://github.com/symfony/symfony/blob/3.4/composer.json#L77
And explained by https://getcomposer.org/doc/04-schema.md#replace
So, as a matter of fact, when you install symfony/symfony
, it acts as a replacement of symfony/templating
at the same version (so 3.4.30
, in your case) but then, you also have the instruction in your composer.json
to install it at the version ^4.3
That is also what those lines are telling you:
- don't install symfony/symfony v3.4.30|remove symfony/templating v4.3.3
- don't install symfony/templating v4.3.3|don't install symfony/symfony v3.4.30
It actually instruct you to either install symfony/symfony v3.4.30
OR symfony/templating v4.3.3
but not both at the same time, because the replace
instruction of the symfony/symfony
package make it the exact same package as symfony/templating
, but not in the same version in your case.
And actually the composer documentation tells you exactly that too:
This is also useful for packages that contain sub-packages, for example the main symfony/symfony package contains all the Symfony Components which are also available as individual packages. If you require the main package it will automatically fulfill any requirement of one of the individual components, since it replaces them.
Source: https://getcomposer.org/doc/04-schema.md#replace
Upvotes: 1