Laravel Composer软件包不会安装

时间:2015-07-22 16:44:30

标签: laravel-5 composer-php

我试图在Laravel中安装Zizaco。 ({{3}}) 当我将"zizaco/entrust": "dev-laravel-5"添加到require然后在cmd中执行编写器更新时,它没有说什么安装或更新。

这是我的整个composer.json文件:

{
    "name": "classpreloader/classpreloader",
    "description": "Helps class loading performance by generating a single PHP file containing all of the autoloaded files for a specific use case",
    "keywords": ["autoload", "class", "preload"],
    "license": "MIT",
    "authors": [
        {
            "name": "Michael Dowling",
            "email": "mtdowling@gmail.com"
        },
        {
            "name": "Graham Campbell",
            "email": "graham@alt-three.com"
        }
    ],
    "require":{
        "php": ">=5.5.9",
        "nikic/php-parser": "~1.3",
        "zizaco/entrust": "dev-laravel-5"
    },

    "require-dev":{
        "phpunit/phpunit": "~4.0"
    },
    "autoload": {
        "psr-4": {
            "ClassPreloader\\": "src/"
        }
    },
    "autoload-dev": {
        "classmap": ["tests/stubs/"]
    },
    "config": {
        "preferred-install": "dist"
    },
    "extra": {
        "branch-alias": {
            "dev-master": "2.0-dev"
        }
    }
}

我在这里做错了什么>>?

由于

编辑---

De文档告诉我:

为了安装Entrust,我们只需要将此行添加到composer.json文件中:

"zizaco/entrust": "dev-laravel-5"
1
You should have something like this:

"require": {
    "php": ">=5.5.9",
    "laravel/framework": "5.1.*",
    "laravelcollective/html": "5.1.*",
   "zizaco/entrust": "dev-laravel-5"
},

Next, run composer update to install Entrust.

2 个答案:

答案 0 :(得分:1)

缺少逗号(,)。

纠正它:

"require":{
    "laravel/framework": "5.1.*",
    "nikic/php-parser": "~1.3", 
    "zizaco/entrust": "dev-laravel-5"
},

答案 1 :(得分:0)

您在" nikic / php-parser":" ~1.3"

之后错过了一个逗号

你的composer.json应该包含:

"require":{
    "php": ">=5.5.9",
    "nikic/php-parser": "~1.3",
    "zizaco/entrust": "dev-laravel-5"
},