Composer not installing dependencies of Package

别来无恙 提交于 2019-12-12 03:40:39

问题


I have two projects. One is my application and the second one is an external module that I want to use in future apps.

I have created my external module on GitHub and included in the composer.json of my application.

My external module gets downloaded / cloned but the required dependencies are not installed by composer.

Here's composer.json of my application:

{
    "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:

{
    "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.

What is it that I am doing wrong here.


回答1:


Try updating the following line in your application composer.json from:

"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.

Although it does not look directly applicable to the dependencies of the external module not installing, it could be the cause.



来源:https://stackoverflow.com/questions/40226203/composer-not-installing-dependencies-of-package

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!