Andrew Fletcher published: 9 May 2022 2 minutes read
Had the situation where you are running composer however, the scripts stops with a prompt? Such as:
- Installing composer/installers (v1.12.0): Extracting archive
composer/installers contains a Composer plugin which is currently not in your allow-plugins config. See https://getcomposer.org/allow-plugins
Do you trust "composer/installers" to execute code and wish to enable it now? (writes "allow-plugins" to composer.json) [y,n,d,?] y
- Installing cweagans/composer-patches (1.7.2): Extracting archive
cweagans/composer-patches contains a Composer plugin which is currently not in your allow-plugins config. See https://getcomposer.org/allow-plugins
Do you trust "cweagans/composer-patches" to execute code and wish to enable it now? (writes "allow-plugins" to composer.json) [y,n,d,?] y
Gathering patches for root package.
Gathering patches for dependencies. This might take a minute.
- Installing drupal/core-composer-scaffold (9.3.12): Extracting archive
drupal/core-composer-scaffold contains a Composer plugin which is currently not in your allow-plugins config. See https://getcomposer.org/allow-plugins
Do you trust "drupal/core-composer-scaffold" to execute code and wish to enable it now? (writes "allow-plugins" to composer.json) [y,n,d,?] y
- Installing drupal/core-project-message (9.3.12): Extracting archive
drupal/core-project-message contains a Composer plugin which is currently not in your allow-plugins config. See https://getcomposer.org/allow-plugins
Do you trust "drupal/core-project-message" to execute code and wish to enable it now? (writes "allow-plugins" to composer.json) [y,n,d,?] y
- Installing zaporylie/composer-drupal-optimizations (1.2.0): Extracting archive
zaporylie/composer-drupal-optimizations contains a Composer plugin which is currently not in your allow-plugins config. See https://getcomposer.org/allow-plugins
Do you trust "zaporylie/composer-drupal-optimizations" to execute code and wish to enable it now? (writes "allow-plugins" to composer.json) [y,n,d,?] y
While this is great, and there are times this is necessary. The inverse is true too... being times where I want to specify 'yes' from the command line so that my install doesn't require interaction.
Solutions
One option is to true no interaction
composer install --no-interaction
or
composer install -n
However, this doesn't always weave it's magic. In this situation, no interaction uses the default. Which could be no. So you're not in control of the script.
Is there a way to select "yes" automatically?
Yes, using the yes command
yes | composer install
Related articles
Andrew Fletcher
•
29 Sep 2023
How to install PHP 8.1 on Ubuntu 20.04
Update Ubuntu 20.04To begin update the server using the commandsudo apt update && sudo apt upgrade -yFor more details about this process see How To Update All Packages Linux. PHP versionCheck the current PHP version usingphp -vThe response I had wasPHP 7.4.3 (cli) (built: Nov 2...
Andrew Fletcher
•
29 Sep 2023
drush/drush[12.0.0, ..., 12.2.0] require composer-runtime-api ^2.2
Resources - changing DrushTypeVersionDrush (current)11.6.0Drush (update)12.2.0Updating Drush went OK on all testing environments until on to the staging environment. The initial error that I saw wasPHP Fatal error: Declaration of Drush\Style\DrushStyle::confirm($question, $default = true) must...
Andrew Fletcher
•
30 Aug 2023
Could not delete /var/www/html/content/vendor/composer/
Attempting to run a composer update command, you know the one used regularlycomposer updateI ran into a 'could not delete' responseLoading composer repositories with package information
Info from https://repo.packagist.org: #StandWithUkraine
Updating dependencies
Nothing to modify in lock...