Composer 不会安装包依赖项

Composer won't install package dependencies

我创建了 composer 包,composer.json 是

{
    "name": "xxxx/yyyyy",
    "description": "xyz",
    "license": "MIT",
    "authors": [
        {
            "name": "xxx",
            "email": "xx@ttt.com"
        }
    ],
    "version": "1.0.0",
    "type": "package",
    "minimum-stability": "dev",
    "require": {
        "php": ">=5.6.4",
        "laravel/framework": "5.3.*",
        "tymon/jwt-auth": "0.5.*",
        "dimsav/laravel-translatable": "^6.0",
        "doctrine/dbal": "^2.5",
        "felixkiss/uniquewith-validator": "2.*",
        "owen-it/laravel-auditing": "^3.1",
        "venturecraft/revisionable": "1.*",
        "yadakhov/insert-on-duplicate-key": "^1.1"
    },
    "autoload": {
        "psr-4": {
            "XXX\YYY\" : "/src"
        }
    }
}

现在,当我安装

xxxx/yyyy

包,我需要作曲家安装所有必需的包:

"require": {
    "php": ">=5.6.4",
    "laravel/framework": "5.3.*",
    "tymon/jwt-auth": "0.5.*",
    "dimsav/laravel-translatable": "^6.0",
    "doctrine/dbal": "^2.5",
    "felixkiss/uniquewith-validator": "2.*",
    "owen-it/laravel-auditing": "^3.1",
    "venturecraft/revisionable": "1.*",
    "yadakhov/insert-on-duplicate-key": "^1.1"
},

但它没有安装它。

我尝试作曲家更新、作曲家安装。有人可以帮忙吗?

项目 Composer.json 看起来像

{    
    "require": {
        "php": ">=5.6.4",
        "laravel/framework": "5.4.*",
        "laravel/tinker": "~1.0",       
        "xxxx/yyyy" : "1.0.0"    
    },    
    "repositories": [
        {
            "type": "package",
            "package": {
                "name": "xxxx/yyyy",
                "version": "1.0.0",
                "source": {
                    "url": "example.com",
                    "type": "git",
                    "reference": "master"
                },
                "autoload": {
                    "psr-4" : {
                       "XXX\YYY\" : "/src"
                    }
                }
            }
       }
    ] 
}

我能做什么,让 Composer 自动安装所有包所需的依赖项????谢谢指教。

不要使用 package 存储库类型。当您使用它时,您必须复制通常驻留在您引用的软件的 composer.json 文件中的所有信息。

package 存储库适用于无法将 composer.json 文件添加到软件来源的情况。您可以完全控制您的包裹,因此这不适用。

只需将 URL 类型 vcs 的存储库 link 添加到存储库中,Composer 将通过查看其中的 composer.json 文件找出其余部分存储库。它将检测依赖项并安装它们。