Composer codeIgniter“无需安装或更新”,甚至可以将库添加到composer JSON中

时间:2018-10-23 08:57:19

标签: php codeigniter

很长一段时间我没有使用codeIgniter作为我的框架。 我要在codeIgniter中使用composer安装库,

我要安装的图书馆是hybridauth,用于使用codeigniter进行社交登录。

我已将"hybridauth/hybridauth": "~3.0"添加到我的composer.json

这是我的整个composer.json

{
    "description": "The CodeIgniter framework",
    "name": "codeigniter/framework",
    "type": "project",
    "homepage": "https://codeigniter.com",
    "license": "MIT",
    "support": {
        "forum": "http://forum.codeigniter.com/",
        "wiki": "https://github.com/bcit-ci/CodeIgniter/wiki",
        "slack": "https://codeigniterchat.slack.com",
        "source": "https://github.com/bcit-ci/CodeIgniter"
    },
    "require": {
        "php": ">=5.3.7",
        "hybridauth/hybridauth": "~3.0"
    },
    "suggest": {
        "paragonie/random_compat": "Provides better randomness in PHP 5.x"
    },
    "require-dev": {
        "mikey179/vfsStream": "1.1.*",
        "phpunit/phpunit": "4.* || 5.*"
    }
}

然后,当我尝试使用此命令composer install安装时,没有任何安装。该命令的输出如下:

Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in 
composer.json. You may be getting outdated dependencies. Run update to update 
them.
Nothing to install or update
Generating autoload files

当我尝试使用composer update时,输出如下所示:

Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package hybridauth/hybridauth master is satisfiable by 
hybridauth/hybridauth[dev-master] but these conflict with your requirements 
or minimum-stability.

感谢您的帮助。

1 个答案:

答案 0 :(得分:0)

您可以编辑

"hybridauth/hybridauth": "~3.0"

"hybridauth/hybridauth": "*"

然后,运行此命令composer update

现在解决了我的问题。