Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.9k views
in Technique[技术] by (71.8m points)

symfony - Composer Conflict

I have a private repository (my/private-repo) that has 2 tags at the same commit.

v1.0.0-RC
v1.0.0

I have a project with composer.json as follows

"require": {
    "php": "^7.3.11",
    "ext-ctype": "*",
    "ext-iconv": "*",
    "ext-json": "*",
    "symfony/console": "^4.0",
    "symfony/dotenv": "^4.0",
    "symfony/flex": "^1.3.1",
    "symfony/framework-bundle": "^4.0",
    "symfony/yaml": "^4.0",
    "my/private-repo": "1.0.0-RC"
  }, 

Running composer update works fine. If I removed the -RC from the last line (so its "my/private-repo": "1.0.0" and run composer update I get the following result

Loading composer repositories with package information
Restricting packages listed in "symfony/symfony" to "4.4.*"
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires my/private-repo 1.0.0 -> satisfiable by my/private-repo[v1.0].
    - my/private-repo v1.0 requires symfony/framework-bundle 4.2.* -> found symfony/framework-bundle[v4.2.0, ..., v4.2.12] but these were not loaded, likely because it conflicts with another require.

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

I have tried with --with-all-dependencies and get the same response. Can anyone help me understand why its failing ?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Have a look down below in your composer.json - Restricting packages listed in "symfony/symfony" to "4.4.*" is a good hint that you've configured Flex to load Symfony v4.4 for your project. According to the given error message, my/private-repo explicitly requires v4.2.

Either downgrade the Symfony version in your composer.json and run composer update afterwards, or check why that private package is not compatible with any later version of Symfony


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...