How to skip suggestions when installing composer

Locally when I run composer install

it shows nothing about suggestions. In our CI environment, it contains a long list of suggestions that I would like to avoid. I want to see what is being output from the cache and something like that, I just don't want to see it. I went through the docs and couldn't figure out how to hide this.

Suggestions (among many others) ...

symfony/security-core suggests installing symfony/expression-language (For using the expression voter)
symfony/routing suggests installing symfony/expression-language (For using expression matching)
predis/predis suggests installing ext-phpiredis (Allows faster serialization and deserialization of the Redis protocol)
phpseclib/phpseclib suggests installing ext-gmp (Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.)
phpseclib/phpseclib suggests installing pear-pear/PHP_Compat (Install PHP_Compat to get phpseclib working on PHP < 4.3.3.)
patchwork/utf8 suggests installing ext-intl (Use Intl for best performance)
monolog/monolog suggests installing aws/aws-sdk-php (Allow sending log messages to AWS services like DynamoDB)

      

How can I hide this conclusion?

+5


source to share


2 answers


When you run composer install

on a project with a file composer.lock

, it just installs the versions locked in the composer.lock file and nothing. In other words, the required packages and versions are already allowed and they just install it.

When you run composer install

in a project without a file composer.lock

, Composer will resolve the required packages and their versions and save them to a file composer.lock

before installing them. In this case, the project has not been configured and you will be notified of other packages offered.



In the second case, you cannot hide the list of suggested packages from the output (at least at the time of writing the answer). In the first case, nothing new, so it doesn't show up at all.

The solution is to push your file composer.lock

to the server, which is good practice after all (you don't want your production server to have different versions of dependencies than your IDE, newer versions might break your site).

+6


source


As of version 1.6.3, there is an option --no-suggest

that hides all suggestions when running composer install or composer update .



+6


source







All Articles