I'm upgrading a site to (not ready to go to 3.1) and when I do I get the following error. How do I resolve this?

composer update craftcms/cms
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: twig/twig[v2.6.2, v2.5.0].
    - Can only install one of: twig/twig[v2.6.2, v2.5.0].
    - Can only install one of: twig/twig[v2.6.2, v2.5.0].
    - craftcms/cms requires twig/twig ~2.6.2 -> satisfiable by twig/twig[v2.6.2].
    - Installation request for craftcms/cms -> satisfiable by craftcms/cms[].
    - Installation request for twig/twig (locked at v2.5.0) -> satisfiable by twig/twig[v2.5.0].

in composer.json I have this

"craftcms/cms": "",

All other plugins were successfully updated.

3 Answers 3


composer update vendor/package by design does not update the dependencies of vendor/package. Instead, use

composer require --update-with-dependencies craftcms/cms:

Per the docs, --update-with-dependencies will

Also update dependencies of the newly required packages, except those that are root requirements

That will update Craft to and, because has a new Twig requirement (~2.6.2, where 3.0.41 used ^2.5.0), it will update Twig as well.


so this was weird.

I had the issue when I ran this composer command

composer update craftcms/cms

however when I ran

composer update

without the specific package all went well.


Craft version released -> https://github.com/craftcms/cms/blob/develop/CHANGELOG-v3.md#31172---2019-03-12

Craft now requires Twig ~2.6.2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.