How to get list of all installed packages along with version in composer?

后端 未结 8 441
温柔的废话
温柔的废话 2020-11-28 18:27

I have been working on a project using Symfony 2.1 on my local machine. I have uploaded it to my server but when I try and install the vendor bundles using Composer, I\'m g

相关标签:
8条回答
  • 2020-11-28 18:29

    The behaviour of this command as been modified so you don't have to pass the -i option:

    [10:19:05] coil@coil:~/workspace/api$ composer show -i
    You are using the deprecated option "installed". 
    Only installed packages are shown by default now. 
    The --all option can be used to show all packages.
    
    0 讨论(0)
  • 2020-11-28 18:32

    List installed dependencies:

    • Flat: composer show -i
    • Tree: composer show -i -t

    -i short for --installed.

    -t short for --tree.

    ref: https://getcomposer.org/doc/03-cli.md#show

    0 讨论(0)
  • 2020-11-28 18:32

    If you want to install Symfony2.2, you can see the complete change in your composer.json on the Symfony blog.

    Just update your file according to that and run composer update after that. That will install all new dependencies and Symfony2.2 on your project.


    If you don't want to update to Symfony2.2, but have dependency errors, you should post these, so we can help you further.

    0 讨论(0)
  • 2020-11-28 18:38

    You can run composer show -i (short for --installed).

    In the latest version just use composer show.

    The -i options has been deprecated.

    You can also use the global instalation of composer: composer global show

    0 讨论(0)
  • 2020-11-28 18:38

    Ivan's answer above is good:

    composer global show -i

    Added info: if you get a message somewhat like:

    Composer could not find a composer.json file in ~/.composer

    ...you might have no packages installed yet. If so, you can ignore the next part of the message containing:

    ... please create a composer.json file ...

    ...as once you install a package the message will go away.

    0 讨论(0)
  • 2020-11-28 18:41

    If you only want to check version for only one, you can do

    composer show -- twig/twig
    

    Note that only installed packages are shown by default now, and installed option is now deprecated.

    0 讨论(0)
提交回复
热议问题