Laravel Composer Update Error - Permission Denied

╄→尐↘猪︶ㄣ 提交于 2019-12-06 02:25:26
MKJ

I found the solution. If you see the error then it would be clear that I don't had access to the:

 "/home/username/.composer/cache/files/symfony/security-core/3a27d7b34ee62cb0fdf5ad970e7777912ef4722f.zip".

When I explore this directory, I found that its owner is 'root' or 'sudo'.

So I deleted the '.composer' directory and then started to update in my laravel project directory, every thing was fine and perfect! No problem at all!

I just run sudo before an all when ok

sudo composer create-project laravel/laravel=5.3 /Users/peter/Sites/blog --prefer-dist

I know its an old topic, but for mac users this might be useful, since commands in macOS are a little bit different from linux distros and I had a hard time figuring this out.

  1. cd into ~ directory
  2. sudo chmod -R 777 .composer

Done. Now you can install/update composer.

I had the same issue with a mac, Composer warn me about running commands with super user permissions, so I've just changed the owner of files directory in the repo /Users/MyUserName/.composer/cache like so:

sudo chown -R MyUserName files/

Hope this helps.

sudo composer update

worked for me. it's a permission issue.

if it doesn't work then you can try to delete '.composer' directory and composer update afterward.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!