Composer loading from cache

前端 未结 9 1287
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-02 04:54

i ran in a problem using composer for installing/uninstalling some dependencies in laravel which coming back after deleting them from composer.json and deleting the

相关标签:
9条回答
  • 2021-02-02 05:30

    composer caches packages under vendor/packagename convention. So you shouldn't run into any issue, just because the packagename is used in another vendor's package.

    the cache locations are:

    • Windows: %LOCALAPPDATA%\Composer\files\vendor\packagename
    • Linux: ~/.composer/cache/files/vendor/packagename
    • Mac OS: ~/.composer/cache/files/packagename
    0 讨论(0)
  • 2021-02-02 05:32

    Don't edit your composer.json file manually to remove a package - it will remain in composer.lock.

    Use composer remove to delete the old package then composer require to install the replacement.

    0 讨论(0)
  • 2021-02-02 05:35

    In some cases (for example OpenSuse 42.1) all user cache are puts in:

    ~/.cache/
    

    For the composer, the same as other applications, the cache path is:

    ~/.cache/composer/
    

    So, just remove this folder as follow:

    rm -fR ~/.cache/composer
    
    0 讨论(0)
  • 2021-02-02 05:37

    So the only thing that worked for me on my Macbook was removing the package from my composer.json, deleting my composer.lock, running composer update, then adding the package back to composer.json, deleting my composer.lock(again), and running composer update (again). I had a local package in my instance of Laravel Nova that I changed to all lowercase from CamelCase and no matter what I did, it kept adding the package with the old CamelCase name. Didn't matter if I cleared caches or anything.

    0 讨论(0)
  • 2021-02-02 05:38

    You can use the following command to clear the cache irrespective of the OS you are on:

    php composer.phar clear-cache
    

    or if composer is installed globally

    composer clear-cache
    

    Hope this helps

    0 讨论(0)
  • 2021-02-02 05:40

    I think, you can run your composer commands with --no-cache option flag like

    composer install --no-cache
    

    Or

    composer require <package-name> --no-cache
    

    Or

    composer update [<package-name>] --no-cache
    
    0 讨论(0)
提交回复
热议问题