Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jaahvicky's avatar

You are running composer as "root" - error

I am using homestead 7 for my local dev work. I recently upgraded to macOS Mojave and today i ran a vagrant box update.

I have added a site on my Homestead.yaml file and when I try to run a vagrant provision i am getting the error below.

homestead-7: You are running composer as "root", while "/home/vagrant/.composer" is owned by "vagrant"
homestead-7: You are already using composer version 1.8.0 (stable channel).

I understand that this has something to do with composer permissions. Does anyone have an idea how the permissions should be set so that the above error doesn't show.

Below is how permissions are set on local and homestead

local
-rwxr-xr-x    1 victor  staff   1892003 Dec 30 11:11 composer
vagrant/homestead
drwxrwxr-x  4 vagrant vagrant 4096 Dec 30 07:17 .composer
0 likes
0 replies

Please or to participate in this conversation.