简体   繁体   English

如果我不想做作曲家更新怎么办,我只想在composer.json和composer.lock中使用它。

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

I have an old composer based symfony project, that I just updated with some changes of code. 我有一个旧的基于作曲家的symfony项目,我刚刚更新了一些代码更改。 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. 在部署要求运行composer.phar自我更新的作曲家以更新作曲家时,我遇到了问题,因为作曲家已经过时了。 After that I do the composer.phar install. 之后我做了composer.phar安装。 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. 我建议你看看composer.lock文件,并注意那里使用的任何版本。 Then copy these into the composer.json , delete the lock file and run a normal install. 然后将它们复制到composer.json ,删除锁定文件并运行正常安装。

Of course, you do this on a copy of your software to see if all the same versions do appear again. 当然,您可以在软件副本上执行此操作,以查看是否所有相同版本再次出现。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM