Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get list of outdated packages

Tags:

composer-php

I want to get list of outdated packages that will be updated when I issue composer update. Does composer have such functionality? if no is there a way to do that (with or without composer?)

like image 602
Stefano Mtangoo Avatar asked Nov 04 '15 17:11

Stefano Mtangoo


People also ask

Can npm detect outdated packages?

Description. This command will check the registry to see if any (or, specific) installed packages are currently outdated. By default, only the direct dependencies of the root project and direct dependencies of your configured workspaces are shown. Use --all to find all outdated meta-dependencies as well.

Which of the following commands can be used to check if the project has all the latest version?

Running the "ncu" command inside your project directory will display all possible updates to your solution. Running "ncu –u" will update all packages to the latest version in package.

How do I update my composer?

update / u# In order to get the latest versions of the dependencies and to update the composer. lock file, you should use the update command.


2 Answers

Since version 1.1 of Composer there is the composer outdated command. With composer outdated --direct only your direct dependencies are taken into account.

like image 26
Xatoo Avatar answered Sep 21 '22 03:09

Xatoo


Update:

Since Composer v1.1 (May 2016) the following commands are available:

  • composer outdated shows you the list of outdated packages
  • composer show -l returns the complete list of packages. packages in need of update are colored red. the (still) up-2-date ones are colored green.
  • both commands accept the parameter --direct to show only direct dependencies in the listing

Referencing:

https://github.com/composer/composer/issues/3771


Composer Plugins

There are some Composer Plugins showing the list of outdated packages:

  1. composer-versions-check - https://github.com/Soullivaneuh/composer-versions-check

    The Composer Plugin called "composer-versions-check" shows outdated packages from last major versions after using the update command. (Latest is ..)

    This plugin runs "update" first, then shows possible "upgrade" indications.

    A Composer dry-run isn't supported, yet.

    Composer-Version-Check-Plugin

  2. vinkla/climb - https://github.com/vinkla/climb

    Climb is a "Composer version manager tool" inspired by npm-check-updates.

    It shows the outdates package version and indicates "upgrades" to latest versions.

like image 89
Jens A. Koch Avatar answered Sep 23 '22 03:09

Jens A. Koch