11

我正在尝试克隆一个 github 存储库并composer install在其上发布一个。但我得到了这个:

警告:锁定文件不是最新的 composer.json 中的最新更改。您可能会得到过时的依赖项。运行 update 来更新它们。

Your requirements could not be resolved to an installable set of packages.  
  Problem 1  
    - Conclusion: remove symfony/polyfill-intl-icu v1.9.0  
    - Installation request for symfony/polyfill-intl-icu v1.9.0 -> satisfiable by symfony/polyfill-intl-icu[v1.9.0].  
    - Conclusion: remove symfony/process v3.4.15  
    - symfony/polyfill-intl-icu v1.9.0 requires symfony/intl ~2.3|~3.0|~4.0 -> satisfiable by symfony/symfony[v4.0.0].  
    - don't install symfony/process v3.4.15|remove symfony/symfony v4.0.0  
    - don't install symfony/symfony v4.0.0|don't install symfony/process v3.4.15  
    - Installation request for symfony/process v3.4.15 -> satisfiable by symfony/process[v3.4.15].  

跑步时composer update

Problem 1
- Conclusion: don't install symfony/symfony v4.1.7
- Conclusion: don't install symfony/symfony v4.1.6
- Conclusion: don't install symfony/symfony v4.1.5
- Conclusion: don't install symfony/symfony v4.1.4
- Conclusion: don't install symfony/symfony v4.1.3
- Conclusion: don't install symfony/symfony v4.1.2
- Conclusion: don't install symfony/symfony v4.1.1
- Conclusion: don't install symfony/symfony v4.1.0
- Conclusion: don't install symfony/symfony v4.0.14
- Conclusion: don't install symfony/symfony v4.0.13
- Conclusion: don't install symfony/symfony v4.0.12
- Conclusion: don't install symfony/symfony v4.0.11
- Conclusion: don't install symfony/symfony v4.0.10
- Conclusion: don't install symfony/symfony v4.0.9
- Conclusion: don't install symfony/symfony v4.0.8
- Conclusion: don't install symfony/symfony v4.0.7
- Conclusion: don't install symfony/symfony v4.0.6
- Conclusion: don't install symfony/symfony v4.0.5
- Conclusion: don't install symfony/symfony v4.0.4
- Conclusion: don't install symfony/symfony v4.0.3
- Conclusion: don't install symfony/symfony v4.0.2
- Conclusion: don't install symfony/symfony v4.0.1
- Conclusion: remove symfony/symfony v4.0.0
- don't install symfony/symfony v4.0.0|remove symfony/process v3.4.15
- don't install symfony/process v3.3.0|don't install symfony/symfony v4.0.0

composer.json(需要部分)

"require": {
    "php": ">=7.1",
    "symfony/symfony": "~4.0",
    "symfony/process": "^3.3",
    "doctrine/orm": "dev-fork as 2.5.6",
    "doctrine/doctrine-bundle": "1.*",
    "symfony/swiftmailer-bundle": "~3.1",
    "symfony/monolog-bundle": "~3.1",
    "sensio/framework-extra-bundle": "^5.1",
    "graylog2/gelf-php": "^1.4",
    "doctrine/doctrine-migrations-bundle": "^1.1",
    "awt/webauth-bundle": "3.0.*",
    "awt/canvas-client-bundle": "6.2.*"
}
4

4 回答 4

11

运行:composer update --lock使您的锁定文件与您的composer.json同步。

于 2020-10-01T15:13:17.357 回答
5

您可以在 composer 上使用depends&prohibits来查看您应该做什么:

composer depends symfony/process 3.4.15

composer prohibits symfony/symfony 4

这两个命令告诉你什么是冲突以及你应该做什么。

主要问题是你composer.jsoncomposer.lock不同步。第一个文件告诉作曲家需要什么包及其版本限制,第二个文件在协作者之间共享完全相同的包版本,以保持一致性。

如果存储库所有者不能帮助您解决此问题,您唯一的方法是:

rm composer.lock
rm -rf vendor
composer install

这将删除供应商目录内容并安装所有依赖项的新副本,仅根据composer.json

于 2018-11-14T17:37:35.283 回答
0

请分享您的 comooser.json 文件,我认为您应该更新它:

    "require": {
    "symfony/process": "3.4.*",
    "symfony/symfony": "3.4.*"
},

或者

 "require": {
    "symfony/process": "4.1.*",
    "symfony/symfony": "4.1.*"
},
于 2018-11-14T09:49:15.330 回答
-3

解决方案是从网站手动下载以前版本的作曲家(1.7.2)并覆盖我的 1.7.3 版本。

于 2018-11-15T16:59:41.540 回答