PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, February 9, 2022

[FIXED] How can I run composer without user interaction?

 February 09, 2022     cakephp, composer-php, php     No comments   

Issue

I'm trying to run composer install on a cakephp installation, however it asks the user if they want to they want to set folder permissions:

Note, this is an example. In production the composer install command will happen automatically via CI or whatever:

John:$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files
> Cake\Composer\Installer\PluginInstaller::postAutoloadDump
> App\Console\Installer::postInstall
Set Folder Permissions ? (Default to Y) [Y,n]?

This is great, but there are times where I want to specify 'yes' from the command line so that my docker install doesn't require interaction, and so that our deployment process can work (there is no user involved!) I've tried several things, inspected the code and googled like mad to no avail.

I'm guessing there's an environment variable I can set to make it default to yes / quiet, but I just can't find what it is.


Solution

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.


Answered By - Loek
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home
View mobile version

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing