Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The lock file is not up to date with the latest changes in composer.json

I'm trying to clone a github repository and issue a composer install on it. But I am getting this:

Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.

Your requirements could not be resolved to an installable set of packages.  
  Problem 1  
    - Conclusion: remove symfony/polyfill-intl-icu v1.9.0  
    - Installation request for symfony/polyfill-intl-icu v1.9.0 -> satisfiable by symfony/polyfill-intl-icu[v1.9.0].  
    - Conclusion: remove symfony/process v3.4.15  
    - symfony/polyfill-intl-icu v1.9.0 requires symfony/intl ~2.3|~3.0|~4.0 -> satisfiable by symfony/symfony[v4.0.0].  
    - don't install symfony/process v3.4.15|remove symfony/symfony v4.0.0  
    - don't install symfony/symfony v4.0.0|don't install symfony/process v3.4.15  
    - Installation request for symfony/process v3.4.15 -> satisfiable by symfony/process[v3.4.15].  

When running composer update

Problem 1
- Conclusion: don't install symfony/symfony v4.1.7
- Conclusion: don't install symfony/symfony v4.1.6
- Conclusion: don't install symfony/symfony v4.1.5
- Conclusion: don't install symfony/symfony v4.1.4
- Conclusion: don't install symfony/symfony v4.1.3
- Conclusion: don't install symfony/symfony v4.1.2
- Conclusion: don't install symfony/symfony v4.1.1
- Conclusion: don't install symfony/symfony v4.1.0
- Conclusion: don't install symfony/symfony v4.0.14
- Conclusion: don't install symfony/symfony v4.0.13
- Conclusion: don't install symfony/symfony v4.0.12
- Conclusion: don't install symfony/symfony v4.0.11
- Conclusion: don't install symfony/symfony v4.0.10
- Conclusion: don't install symfony/symfony v4.0.9
- Conclusion: don't install symfony/symfony v4.0.8
- Conclusion: don't install symfony/symfony v4.0.7
- Conclusion: don't install symfony/symfony v4.0.6
- Conclusion: don't install symfony/symfony v4.0.5
- Conclusion: don't install symfony/symfony v4.0.4
- Conclusion: don't install symfony/symfony v4.0.3
- Conclusion: don't install symfony/symfony v4.0.2
- Conclusion: don't install symfony/symfony v4.0.1
- Conclusion: remove symfony/symfony v4.0.0
- don't install symfony/symfony v4.0.0|remove symfony/process v3.4.15
- don't install symfony/process v3.3.0|don't install symfony/symfony v4.0.0

composer.json (require section)

"require": {
    "php": ">=7.1",
    "symfony/symfony": "~4.0",
    "symfony/process": "^3.3",
    "doctrine/orm": "dev-fork as 2.5.6",
    "doctrine/doctrine-bundle": "1.*",
    "symfony/swiftmailer-bundle": "~3.1",
    "symfony/monolog-bundle": "~3.1",
    "sensio/framework-extra-bundle": "^5.1",
    "graylog2/gelf-php": "^1.4",
    "doctrine/doctrine-migrations-bundle": "^1.1",
    "awt/webauth-bundle": "3.0.*",
    "awt/canvas-client-bundle": "6.2.*"
}
like image 965
user6313136 Avatar asked Nov 14 '18 00:11

user6313136


People also ask

How do I update my composer lock?

As mentioned above, the composer.lock file prevents you from automatically getting the latest versions of your dependencies. To update to the latest versions, use the update command. This will fetch the latest matching versions (according to your composer.json file) and update the lock file with the new versions.

What is composer json lock?

composer. lock records the exact versions that are installed. So that you are in the same versions with your co-workers. composer install.


2 Answers

Run: composer update --lock to get your lock file in sync with your composer.json.

like image 54
Connor Leech Avatar answered Sep 21 '22 18:09

Connor Leech


You may use depends & prohibits on composer to see what exactly you should do:

composer depends symfony/process 3.4.15

and

composer prohibits symfony/symfony 4

This two commands tell you what is the conflict and what you should do.

The main problem is that your composer.json and composer.lock are not in sync. The first file tells composer what are required package & their version constraints, and the second one shares the exact same package version between collaborators, for consistency.

If the repository owner does not help you with this problem, the only way you have is:

rm composer.lock
rm -rf vendor
composer install

This will remove vendor directory contents and install a fressh copy of all dependencies, according to just composer.json

like image 25
Pmpr.ir Avatar answered Sep 23 '22 18:09

Pmpr.ir