Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --allow-root option #6183

Closed
nicodmf opened this issue Feb 19, 2017 · 9 comments
Closed

Add --allow-root option #6183

nicodmf opened this issue Feb 19, 2017 · 9 comments

Comments

@nicodmf
Copy link

nicodmf commented Feb 19, 2017

As bower permit it, and because CI and docker containers are more suitable with a the root user, it seems to me better to have a allow root option.

Maybe a ticket exists, but my search give me many pages and the first and second doesn't mention any such option.

When I run this command:

...composer install

I get the following output:

...Do not run Composer as root/super user! See https://getcomposer.org/root for details

And I expected this to happen:

A normal process

@alcohol
Copy link
Member

alcohol commented Feb 20, 2017

https://getcomposer.org/doc/03-cli.md#composer-allow-superuser

@alcohol alcohol closed this as completed Feb 20, 2017
@henrypenny
Copy link

For example (on linux):
$ export COMPOSER_ALLOW_SUPERUSER=1; composer show;

@RScottLewis
Copy link

That worked. Thank you!

@mayankpandav
Copy link

sudo chown -R $USER $HOME/.composer

@JWPapi
Copy link

JWPapi commented Sep 21, 2019

The last one is the right solution, there is a reason why there is a warning.

@emmanuelkafuihayibor
Copy link

Thanks so much

@judgej
Copy link

judgej commented Nov 3, 2020

You can also do this in a bash shell:

$ COMPOSER_ALLOW_SUPERUSER=1 composer show

There is no need to make the variable global in your shell or exported - it is only set for the composer process then thrown away. This can help to keep the environment clean.

@maherelgamil
Copy link

Run the following line directly from your server:

export COMPOSER_ALLOW_SUPERUSER=1;

or Add it to your bash script

@shawn-thesignchef
Copy link

You can also just:

yes | composer show

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants