简体   繁体   English

Composer没有安装Package的依赖项

[英]Composer not installing dependencies of Package

I have two projects. 我有两个项目。 One is my application and the second one is an external module that I want to use in future apps. 第一个是我的application ,第二个是我要在以后的应用程序中使用的external module

I have created my external module on GitHub and included in the composer.json of my application. 我已经在GitHub上创建了我的外部模块,并包含在我的应用程序的composer.json中。

My external module gets downloaded / cloned but the required dependencies are not installed by composer . 我的external module 下载 / 克隆,required dependencies are not installed by composer

Here's composer.json of my application: 这是我的应用程序的composer.json:

{
    "name": "application",
    "description": "Skeleton Application for ZF2",
    "license": "BSD-3-Clause",
    "keywords": [
        "framework",
        "zf2"
    ],
    "homepage": "http://framework.zend.com/",
    "require": {
        "php": ">=5.5",
        "zendframework/zendframework": "2.*",
        "zf-commons/zfc-user": "1.4.4",
        "doctrine/doctrine-orm-module": "~0.9.2",
        "zf-commons/zfc-user-doctrine-orm": "1.0.*",
        "zendframework/zend-developer-tools": "^0.0.2",
        "username/GlideUser": "dev-master"
    },
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/username/GlideUser.git"
        }
    ]
}

Here's composer.json of my external module: 这是我的外部模块的composer.json:

{
    "name": "username/glide-user",
    "description": "Module For Zend Framework 2",
    "type": "library",
    "license": "BSD-3-Clause",
    "homepage": "https://github.com/username/GlideUser",
    "keywords": [
        "zf2",
        "zfc-user",
        "bjyauthorize"
    ],
    "authors": [
        {
            "name": "Haris Mehmood",
            "email": "abc@outlook.com",
            "homepage": "abc.com",
            "role": "Developer"
        }
    ],
    "minimum-stability": "dev",
    "prefer-stable": true,
    "require": {
        "php": ">=5.3.3",
        "bjyoungblood/bjy-authorize": "1.4.0"
    },
    "autoload": {
        "psr-0": {
            "GlideUser\\": "src/"
        }
    }
}

When I run composer install or composer update I expect bjyauthorize package to gets installed, but composer ignore the dependency and install everything else. 当我运行composer installcomposer update时,我希望安装bjyauthorize软件包,但是composer会忽略依赖关系并安装其他所有内容。

What is it that I am doing wrong here. 我在这里做错了什么。

Try updating the following line in your application composer.json from: 尝试从以下位置更新应用程序composer.json中的以下行:

"username/GlideUser": "dev-master"

to: 至:

"username/glide-user": "dev-master"

This way, what is being required matches the name of the external module, which is the name defined inside the external module's composer.json. 这样,所需的与外部模块的名称匹配,该名称是在外部模块的composer.json内部定义的名称。

Although it does not look directly applicable to the dependencies of the external module not installing, it could be the cause. 尽管它看起来并不直接适用于未安装的外部模块的依赖项,但这可能是原因。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM