Why isn't the Composer project for Laravel running?

It seems that if I do not use sudo, my compiler team will not be able to create the Laravel project.

Without sudoit, it raises the following error:

[ErrorException]                                                             
  copy(/Users/H/.composer/cache/files/laravel/laravel/73094f2633f1b90f3ef  
  6de4a8a5b610532510e0e.zip): failed to open stream: Permission denied  

What am I missing here?

+4
source share
1 answer

If you ever do:

sudo composer <anything>

Some of your composer's source files ( ~/.composer/) will be written with root, and if you cannot delete or write them again, if you are not using sudoto become root, you have 2 options:

1) Change the user of these files to your own:

sudo chown $USER:$USER -R ~/.composer

Or on mac

sudo chown -R $USER:staff ~/.composer

2) ( ) :

sudo rm -rf ~/.composer/cache

sudo rm -rf ~/.composer
+12

Source: https://habr.com/ru/post/1532234/


All Articles