Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Composer doesn't update outdated dependencies

Well, after running command composer outdated I can see there's newer version of phpdocumentor/type-resolver available. Installed version is 0.2.1 and the latest one is 0.3.0. Need to say that it was indirectly installed by component I use and not by me.

Problem is when I run composer update or composer update phpdocumentor/type-resolver it says "Nothing to install or update". Why and how to fix?

like image 432
Goujon Avatar asked Jun 08 '17 13:06

Goujon


2 Answers

probably some dependency have fixed the package release you want to install. Try so the the output of the command to check who are using and at which version the package you listed:

composer why-not phpdocumentor/type-resolver 0.3.0

NB: in the current version of the documentation of composer the command is named prohibits, so in case this doesn't work try with:

composer prohibits phpdocumentor/type-resolver 0.3.0

Hope this help

like image 132
Matteo Avatar answered Sep 27 '22 18:09

Matteo


You might have version constraints blocking the upgrade in your composer.json file. This is intended to prevent adding in breaking changes. In your example, the versions are pre-release (0.*), so versioning constraints even act on the miner version.

If you are confident there are no breaking changes or you are prepared to deal with them, edit your composer.json file. Change something like:

"phpdocumentor/type-resolver": "0.2.1",

to

"phpdocumentor/type-resolver": "^0.3",

Try composer upgrade again and test it out to make sure everything is ok.

like image 20
Jahmic Avatar answered Sep 27 '22 18:09

Jahmic