What if I don't want to do composer update, I just want to use what ever in composer.json and composer.lock

StackOverflow https://stackoverflow.com/questions/15700841

  •  30-03-2022
  •  | 
  •  

Question

I have an old composer based symfony project, that I just updated with some changes of code. I tested in development everything works fine. I have got issue when deploying the composer asked to run composer.phar self-update to update the composer since the composer is outdated. After that I do the composer.phar install. I get this error -

[RuntimeException]                                                                                                            
Your composer.lock was created before 2012-09-15, and is not supported anymore. Run "composer update" to generate a new one.

What if I don't want to update. I am okay this. How can I force it not to update.

Était-ce utile?

La solution

The structure of the lock file was changed, and therefor you should upgrade your lock file. You can upgrade your lock file without actually upgrading any dependencies by executing:

composer update nothing

Autres conseils

I would suggest you look at the composer.lock file and note any versions that are used there. Then copy these into the composer.json, delete the lock file and run a normal install.

Of course, you do this on a copy of your software to see if all the same versions do appear again.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top