PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, January 20, 2022

[FIXED] Composer Conflict

 January 20, 2022     composer-php, symfony     No comments   

Issue

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 ?


Solution

I discovered the reason for the error. There was another tag within the my/private-repo of v1.0 which was against a commit from a previous version. It seems that composer picks up v1.0 even though I specified 1.0.0.

Removing the previous tag fixed the issue



Answered By - Manse
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing