Permissions problems with composer and artisan


  • | 286 points

    Hello,

    I am running Laravel 8, with php 7.4.8 using laragon on windows 10 and I have found myself in a situation where I cannot clear cache, run any composer commands or artisan cache:clear.

    Composer install and composer update give the following:
    [RuntimeException]
    Could not delete C:\laragon\www\disco\vendor/composer/package-versions-deprecated\CHANGELOG.md:
    This can be due to an antivirus or the Windows Search Indexer locking the file while they are analyzed

    Composer dump-autoload gives the following:
    [ErrorException]
    rename(C:\laragon\www\disco/vendor/composer/package-versions-deprecated/src/PackageVersions/Versions.php_tmp611910fc60f727.04398384,C:\laragon\www\disco/vendor/composer/package-versions-deprecated
    /src/PackageVersions/Versions.php): Access is denied. (code: 5)

    Php artisan cache:clear gives the following:
    Failed to clear cache. Make sure you have the appropriate permissions.

    This is all new behaviour, I have had no issues working on this project until recently.

    I have tried many times to update the permissions with chmod to no effect.

    Any help would be very much appreciated.

    Thank you


  • | 16349 points

    @stitchtrove I've had problems with composer v2.1+, I found the 2.0 version to be more stable on Windows. This may be worth a try:

    composer self-update 2.0.14
    

Log in to reply
 

Looks like your connection to Laragon was lost, please wait while we try to reconnect.