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
  •  | 
  •  

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.

有帮助吗?

解决方案

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

其他提示

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top