Google-api-php-client: Composer install/update: Could not delete ....

Created on 13 Jun 2019  路  8Comments  路  Source: googleapis/google-api-php-client

Hey there,

everytime we running composer update or composer install we have to remove the folder by hand. Anybody got an idea what the problem is?

Environment details

  • OS:

    • Host: Windows 10

    • Docker-Container: Alpine

  • PHP version: 7.1.14
  • Package name and version: google/apiclient-services v0.102

Steps to reproduce

  1. composer install or composer update

Code example

- Updating google/apiclient-services (v0.101 => v0.102):
  Update failed (Could not delete /vendor/google/apiclient-services/src/Google/Service/Compute: )
  Would you like to try reinstalling the package instead [yes]? yes
- Removing google/apiclient-services (v0.101)

[RuntimeException] Could not delete /vendor/google/apiclient-services/src/Google/Service/Compute:

Thanks!

question

Most helpful comment

I had the same issue. Weirdly, it seemed like related to permissions.

Try doing this.

chmod -R 777 vendor

And, then run composer install or composer update

I guess by default vendor has 777 permission, but still, welcome to world of PHP! :/

All 8 comments

Are you running composer within docker or on the host machine? If you mix the two, you may encounter permissions issues which will prevent your deleting the files. If you ensure you always run composer in the same context, does the issue resolve itself?

Are you running composer within docker or on the host machine? If you mix the two, you may encounter permissions issues which will prevent your deleting the files. If you ensure you always run composer in the same context, does the issue resolve itself?

We always run composer in the docker container. The problem only occurs with this package and we have a lot of dependencies. 馃槩

Same issue here. We have tried also following to run in the VM:

sudo rm ./vendor
composer install
composer require google/apiclient:"^2.0"

Still, same error although as you can see, context is the same. This is indeed related to permissions, but the issue is somewhere in this package.

I had the same issue. Weirdly, it seemed like related to permissions.

Try doing this.

chmod -R 777 vendor

And, then run composer install or composer update

I guess by default vendor has 777 permission, but still, welcome to world of PHP! :/

I'm going to close this issue out. If you're still having trouble, please feel free to re-open! Hopefully the solution suggested by @UnnitMetaliya works for everybody. :)

Even though this issue has been closed, I'd thought I'd contribute.

I ran into the same issue and when I went looking for the problem I'd noticed that the PHP version set in composer.json (PHP 7.2) did not match the PHP version that was actually installed (7.4). I was able to fix it by simply setting the PHP version to the actual version and re-running require command.

Hope this helps.

I had the same issue. Weirdly, it seemed like related to permissions.

Try doing this.

chmod -R 777 vendor

And, then run composer install or composer update

I guess by default vendor has 777 permission, but still, welcome to world of PHP! :/

chmod: cambiando los permisos de 'vendor/EVERY-PACKAGE-ANME': Permission denied

It is the message.
Is it problem from composer?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ysaurabh33 picture ysaurabh33  路  3Comments

mandavister picture mandavister  路  4Comments

Romain picture Romain  路  4Comments

usamamashkoor picture usamamashkoor  路  5Comments

unixkapl picture unixkapl  路  3Comments