How can I run composer without user interaction?

As stated in the previous answers --no-interaction or -n parameter is the official way to disable the regular user interaction on all composer commands. For more information check the available global options: https://getcomposer.org/doc/03-cli.md#global-options

However, Composer sometimes asks for questions that need an answer. For instance:

composer update

...

In GitDownloader.php line 112:
                                                                                                                                   
The .git directory is missing from ..., see https://getcomposer.org/commit-deps for more information

In these cases, if the --no-interaction parameter is specified, then Composer fails with an error.

To avoid the --no-interaction error, the yes command to the rescue:

yes | composer update

Try composer install --no-interaction or composer install -n

According to the documentation this triggers Composer to pick the default option whenever an interactive action is necessary:

--no-interaction (-n): Do not ask any interactive question.