Can't get composer “path” repository to work

前端 未结 5 1765
庸人自扰
庸人自扰 2020-12-29 19:02

I have a directory structure like so:

composer.json < Main
  packages/
    balunker/
      testpackage/
        composer.json < Package
        src/
           


        
5条回答
  •  囚心锁ツ
    2020-12-29 19:35

    What helped me resolve was composer clear-cache and then running composer update.

    Explanation: I had initially tried to composer install my/package which failed on dependency versions. So I needed to make some local modifications to make it work with Laravel 6.0. However, it continued checking for the wrong version of Laravel packages which led me to believe it was not seeing my local repository which I set in the repositories key with "type": "path". I first ensured the path existed and I was on the correct branch (master which is why I use dev-master in my composer.json). Once I cleared the composer cache and ran the update it updated using my local path with no dependency issues.

    "repositories": [
        {
            "type": "path",
            "url": "../libs/package-name"
        }
    ],
    "require-dev": {
        "pkg-maintainer/package-name": "dev-master"
    }
    

提交回复
热议问题