When i install some libs to my symfony 4.3 project with flex:
composer require twig monolog
Outputs:
Using version ^1.0 for symfony/twig-pack
Using version ^3.4 for symfony/monolog-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.3.*"
Package operations: 5 installs, 0 updates, 0 removals
- Installing twig/extra-bundle (v2.12.1): Loading from cache
- Installing symfony/twig-pack (v1.0.0): Loading from cache
- Installing monolog/monolog (1.25.1): Loading from cache
- Installing symfony/monolog-bridge (v4.3.5): Loading from cache
- Installing symfony/monolog-bundle (v3.4.0): Loading from cache
Writing lock file
Generating autoload files
Symfony operations: 2 recipes (9554635a5313eba1c8b1d73eafba51c3)
- Configuring twig/extra-bundle (>=v2.12.1): From auto-generated recipe
- Configuring symfony/monolog-bundle (>=3.3): From github.com/symfony/recipes:master
Executing script cache:clear
They are added to symfony.lock but not to composer.json.
So when i next run
composer update
The libraries are removed and unconfigured again.
Loading composer repositories with package information
Updating dependencies (including require-dev)
Restricting packages listed in "symfony/symfony" to "4.3.*"
Package operations: 0 installs, 0 updates, 5 removals
- Removing twig/extra-bundle (v2.12.1)
- Removing symfony/twig-pack (v1.0.0)
- Removing symfony/monolog-bundle (v3.4.0)
- Removing symfony/monolog-bridge (v4.3.5)
- Removing monolog/monolog (1.25.1)
Writing lock file
Generating autoload files
Symfony operations: 2 recipes (0637fcde6e70b4f7a32f5fed62f0c462)
- Unconfiguring twig/extra-bundle (>=v2.12.1): From auto-generated recipe
- Unconfiguring symfony/monolog-bundle (>=3.3): From github.com/symfony/recipes:master
Executing script cache:clear
Is this normal behaviour?
Seems a bit odd to me.
This happened because there was an error in the project during the following cache:clear in composer update.
Installation failed, reverting ./composer.json to its original
content.
Then composer or flex starts a rollback and the composer.json is not updated, the symfony.lock however remains updated.
Related
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.
I am trying to create new project using following command but it stops at last line for hours. I have pasted the output from command.
I have tried updating composer also.
$ composer create-project symfony/website-skeleton my_project_name
The script began well
Creating a "symfony/website-skeleton" project at "./my_project_name"
Installing symfony/website-skeleton (v5.0.99)
- Installing symfony/website-skeleton (v5.0.99): Loading from cache
Created project in C:\Users\Captain\Desktop\my_project_name
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
- Installing symfony/flex (v1.6.2): Loading from cache
Symfony operations: 1 recipe (2d3facef6986e76f376f76f911c83b03)
- Configuring symfony/flex (>=1.0): From github.com/symfony/recipes:master
Loading composer repositories with package information
Updating dependencies (including require-dev)
Restricting packages listed in "symfony/symfony" to "5.0.*"
But nothing happens after this line.
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
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
$ php composer.phar update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Terminated
Composer terminated when I try to update dependencies in my symfony2 application. Where can be problem?
Edit
I tried to run composer diag and output was:
Checking platform settings: OK
Checking http connectivity: OK
Checking composer.json:
[ErrorException]
Undefined index: require-dev
But there is no line "require-dev" in my composer.json.