DEV Community

Cover image for Dev Notes #1 - Upgrade to Composer version 2

Dev Notes #1 - Upgrade to Composer version 2

Recently I have upgraded to Composer version 2, as well as upgraded all globally installed packages. Here's a list of commands I have used:

  • composer self-update --2 - Update composer to version 2. To read more about Composer 2 benefits, read the Composer 2.0 announcement. Read more about self-update command here.

  • composer -V - check version

    $ composer -V
    Composer version 2.0.8 2020-12-03 17:20:38
    
  • composer global show - Shows information about globally installed packages. Read more about the show command here.

    $ composer global show
    friendsofphp/php-cs-fixer          v2.17.3 A tool to automatically fix PHP code style
    laravel/installer                  v4.1.1  Laravel application installer.
    php-cs-fixer/diff                  v1.3.1  sebastian/diff v2 backport support for PHP5.6
    squizlabs/php_codesniffer          3.5.8   PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.
    
  • composer global outdated - Shows a list of globally installed packages that have updates available, including their latest version. Read more about the outdated command here.

    $ composer global outdated
    php-cs-fixer/diff v1.3.1 v2.0.2 sebastian/diff v2 backport support for PHP5.6
    
  • composer global update - Upgrades your global dependencies to the latest version according to composer.json, and updates the composer.lock file. Read more about the update command here.

  • composer global update laravel/installer - Upgrades a given globally installed package to the latest version according to composer.json, and updates the composer.lock file.

Top comments (0)