Skip to content

Composer show where package is composer/composer #10493

@llaville

Description

@llaville

I used the PHAR version of Composer 2.2 (sel-updated from 2.1 today), on my Ubuntu 18.04 LTS, Windows WSL2 environment

lrwxrwxrwx 1 root     root          25 Dec 18 07:57 /usr/local/bin/composer -> /usr/local/bin/composer-2
-rwxr-xr-x 1 devilbox devilbox 2358836 Jan 29 07:24 /usr/local/bin/composer-2

Output of composer diagnose:

Checking composer.json: OK
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com rate limit: OK
Checking disk free space: OK
Checking pubkeys:
Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0  87719BA6 8F3BB723 4E5D42D0 84A14642
Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B  0C708369 153E328C AD90147D AFE50952
OK
Checking composer version: OK
Composer version: 2.2.5
PHP version: 7.4.0 - Package overridden via config.platform, actual: 7.4.27
PHP binary path: /usr/local/bin/php
OpenSSL version: OpenSSL 1.1.1d  10 Sep 2019
cURL version: 7.64.0 libz 1.2.11 ssl OpenSSL/1.1.1d
zip: extension present, unzip present, 7-Zip not available

When I run this command:

composer show composer/semver -vvv

I get the following output:

Running 2.2.5 (2022-01-21 17:25:52) with PHP 7.4.27 on Linux / 4.19.128-microsoft-standard
Reading ./composer.json (/shared/backups/bartlett/php-compatinfo-db/composer.json)
Loading config file ./composer.json (/shared/backups/bartlett/php-compatinfo-db/composer.json)
Checked CA file /etc/pki/tls/certs/ca-bundle.crt does not exist or it is not a file.
Checked directory /etc/pki/tls/certs/ca-bundle.crt does not exist or it is not a directory.
Checked CA file /etc/ssl/certs/ca-certificates.crt: valid
Executing command (/shared/backups/bartlett/php-compatinfo-db): git branch -a --no-color --no-abbrev -v
Failed to initialize global composer: Composer could not find the config file: /home/devilbox/.composer/composer.json

Reading /shared/backups/bartlett/php-compatinfo-db/vendor/composer/installed.json
Loading plugin cweagans\Composer\Patches (from cweagans/composer-patches)
name     : composer/semver
descrip. : Semver library that offers utilities, version constraint parsing and validation.
keywords : semantic, semver, validation, versioning
versions : * 3.2.7
type     : library
license  : MIT License (MIT) (OSI approved) https://spdx.org/licenses/MIT.html#licenseText
homepage :
source   : [git] https://github.com/composer/semver.git deac27056b57e46faf136fae7b449eeaa71661ee
dist     : [zip] https://api.github.com/repos/composer/semver/zipball/deac27056b57e46faf136fae7b449eeaa71661ee deac27056b57e46faf136fae7b449eeaa71661ee
path     : /shared/backups/bartlett/php-compatinfo-db/vendor/composer/semver
names    : composer/semver

support
irc : irc://irc.freenode.org/composer
issues : https://github.com/composer/semver/issues
source : https://github.com/composer/semver/tree/3.2.7

autoload
psr-4
Composer\Semver\ => src

requires
php ^5.3.2 || ^7.0 || ^8.0

requires (dev)
phpstan/phpstan ^0.12.54
symfony/phpunit-bridge ^4.2 || ^5

This is expected output (package type = library)

But when I try with composer/composer itself that is also a package type = library, I got following output

Running 2.2.5 (2022-01-21 17:25:52) with PHP 7.4.27 on Linux / 4.19.128-microsoft-standard
Reading ./composer.json (/shared/backups/bartlett/php-compatinfo-db/composer.json)
Loading config file ./composer.json (/shared/backups/bartlett/php-compatinfo-db/composer.json)
Checked CA file /etc/pki/tls/certs/ca-bundle.crt does not exist or it is not a file.
Checked directory /etc/pki/tls/certs/ca-bundle.crt does not exist or it is not a directory.
Checked CA file /etc/ssl/certs/ca-certificates.crt: valid
Executing command (/shared/backups/bartlett/php-compatinfo-db): git branch -a --no-color --no-abbrev -v
Failed to initialize global composer: Composer could not find the config file: /home/devilbox/.composer/composer.json

Reading /shared/backups/bartlett/php-compatinfo-db/vendor/composer/installed.json
Loading plugin cweagans\Composer\Patches (from cweagans/composer-patches)


  [InvalidArgumentException]
  Package composer/composer not found


Exception trace:
 () at phar:///usr/local/bin/composer-2/src/Composer/Command/ShowCommand.php:254
 Composer\Command\ShowCommand->execute() at phar:///usr/local/bin/composer-2/vendor/symfony/console/Command/Command.php:245
 Symfony\Component\Console\Command\Command->run() at phar:///usr/local/bin/composer-2/vendor/symfony/console/Application.php:835
 Symfony\Component\Console\Application->doRunCommand() at phar:///usr/local/bin/composer-2/vendor/symfony/console/Application.php:185
 Symfony\Component\Console\Application->doRun() at phar:///usr/local/bin/composer-2/src/Composer/Console/Application.php:336
 Composer\Console\Application->doRun() at phar:///usr/local/bin/composer-2/vendor/symfony/console/Application.php:117
 Symfony\Component\Console\Application->run() at phar:///usr/local/bin/composer-2/src/Composer/Console/Application.php:131
 Composer\Console\Application->run() at phar:///usr/local/bin/composer-2/bin/composer:83
 require() at /usr/local/bin/composer-2:29

show [--all] [--locked] [-i|--installed] [-p|--platform] [-a|--available] [-s|--self] [-N|--name-only] [-P|--path] [-t|--tree] [-l|--latest] [-o|--outdated] [--ignore IGNORE] [-m|--minor-only] [-D|--direct] [--strict] [-f|--format FORMAT] [--no-dev] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--] [<package>] [<version>]

And I expected this to happen: The same kind of results that we got wit composer/semver

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions