fxpio / composer-asset-plugin

NPM/Bower Dependency Manager for Composer
MIT License
893 stars 156 forks source link

The risk of running composer update as root #213

Closed dbd5 closed 8 years ago

dbd5 commented 8 years ago

Hi;

When you attempt to run composer as root, you get the following error - which is OK; Running composer as root/super user is highly discouraged as packages, plugins and scripts cannot always be trusted;

In the last few days however, I have have had the following error repeatedly and each time, if I elevate privileges to root and run, the update occurs flawlessly. The question therefore is - is this really a package dependency problem?

Regards,

Adam


Your requirements could not be resolved to an installable set of packages.

Problem 1

Potential causes:

Read https://getcomposer.org/doc/articles/troubleshooting.md for further common problems.

cebe commented 8 years ago

could it be that you have installed the composer asset plugin for the root user only?

dbd5 commented 8 years ago

@cebe this is unlikely as I began to see this error only about 3 days ago and ordinarily I would not do composer update as root but I tried it as a work around because there are many stackoverflow comments on composer not updating correctly for regular user. How can I troubleshoot this?

cebe commented 8 years ago
  1. update composer and the asset plugin to the latest version. Composer update as root, if you have a global install of it, but the asset plugin as normal user. I would never run composer itself as root as you are mixing different environments then.
  2. run composer update as normal user and see if it works.
  3. if that did not work, remove composer.lock and vendor directory and run composer update again.
dbd5 commented 8 years ago

Thanks, got it