Search code examples
phplaravelcomposer-php

Laravel composer install giving error "Your lock file does not contain a compatible set of packages please run composer update"


I have been writing laravel code for quite sometime. Currently, I tried cloning a project from github and editing locally. I installed composer in my project directory but a vendor folder was not included, I tried to run composer install but I gives me this error

Your lock file does not contain a compatible set of packages. Please run composer update

How do I resolve this?

Note: I have tried running composer update on previous clones and that didn't work.


Solution

  • I solved this problem with this command:

    composer self-update --1
    

    It probably works because at time that the project was developed, composer was on another version and when change the Major version from 1 to 2 the compatibility was broke. With this command you downgrade composer and probably going to solve this