douhao3562 2016-07-18 12:30
浏览 290

Laravel Composer错误“找不到匹配的包”

I am working with a team using Git on a project that uses laravel and composer. Where I have to clone the repository and change the configuration to work on my machine.

one of the configuration is to install the package dependencies using composer install command

I was working on the project with the team normally without changing anything to composer.json file. Additionally I am using Laravel Framework version 5.2.39 and PHP 5.5.36 and it's different than the versions that specified on the composer.json file.

I had to make a copy of the project with a different name (because an issue with merge branches) and clone the repository again from github and do the configuration again

when I tried to install the dependencies using composer I get this error:

enter image description here

While if I try to install the dependencies on the old project (it's the same project with the same composer.json) I don't get any problem

enter image description here

this is the content of composer.json:

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "require": {
        "laravel/framework": "4.2.*",
        "way/generators": "2.*",
        "paypal/rest-api-sdk-php": "*",
        "chrisbjr/api-guard": "0.*",
        "parse/php-sdk": "1.1.*",
        "ktamas77/firebase-php": "dev-master",
        "toin0u/geotools-laravel": "0.2.*",
        "firebase/token-generator": "^3.0"

    },
    "autoload": {
        "classmap": [
            "app/commands",
            "app/controllers",
            "app/models",
            "app/database/migrations",
            "app/database/seeds",
            "app/tests/TestCase.php"
        ]
    },
    "scripts": {
        "post-install-cmd": [
            "php artisan clear-compiled",
            "php artisan optimize"
        ],
        "post-update-cmd": [
            "php artisan clear-compiled",
            "php artisan optimize"
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ]
    },
    "config": {
        "preferred-install": "dist"
    },
    "minimum-stability": "stable"
}

I tried to change laravel/framework from

"laravel/framework": "4.2.*",

To 5.2.* since my version is 5.2.39

"laravel/framework": "5.2.*",

When I try again composer install I received a new error message

enter image description here

Does anyone face similar error?

  • 写回答

2条回答 默认 最新

  • dongying6896 2016-07-18 15:02
    关注

    In your composer.json file update the following line

    "require": {
        "laravel/framework": "5.2.*",
    

    It was saying 4.2.
    And then update composer.

    评论

报告相同问题?

悬赏问题

  • ¥15 数学的三元一次方程求解
  • ¥20 iqoo11 如何下载安装工程模式
  • ¥15 本题的答案是不是有问题
  • ¥15 关于#r语言#的问题:(svydesign)为什么在一个大的数据集中抽取了一个小数据集
  • ¥15 C++使用Gunplot
  • ¥15 这个电路是如何实现路灯控制器的,原理是什么,怎么求解灯亮起后熄灭的时间如图?
  • ¥15 matlab数字图像处理频率域滤波
  • ¥15 在abaqus做了二维正交切削模型,给刀具添加了超声振动条件后输出切削力为什么比普通切削增大这么多
  • ¥15 ELGamal和paillier计算效率谁快?
  • ¥15 蓝桥杯单片机第十三届第一场,整点继电器吸合,5s后断开出现了问题