duanli8391
2016-10-01 20:34
浏览 110
已采纳

无法从我的源供应商安装Laravel / autoload.php由于某种原因未生成

I want to create another environment of my project so i decided to do it via source control and not just copy paste of the source files.

So what i did is git clone...
cd to the app folder
run composer install

the install threw an exception: [RuntimeException] Could not scan for classes inside "vendor/autoload.php" which does not appear to be a file nor a folder

As far as I know, this vendor/autoload.php file supposed to be generated by the composer install command. composer update or -no-scripts gave the same result...

this is my composer.json:

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.5.9",
        "laravel/framework": "5.2.*",
        "torann/geoip": "0.2.*@dev"
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "~4.0",
        "symfony/css-selector": "2.8.*|3.0.*",
        "symfony/dom-crawler": "2.8.*|3.0.*"
    },
    "autoload": {
        "classmap": [
            "database",
            "app/Facades",
            "app/Services",
            "vendor/autoload.php"
        ],
        "psr-4": {
            "App\\": "app/"
        }
    },
    "autoload-dev": {
        "classmap": [
            "tests/TestCase.php"
        ]
    },
    "scripts": {
        "post-root-package-install": [
            "php -r \"copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ],
        "post-install-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postInstall",
            "php artisan optimize"
        ],
        "post-update-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postUpdate",
            "php artisan optimize"
        ]
    },
    "config": {
        "preferred-install": "dist"
    }
}
  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

2条回答 默认 最新

  • dongqing314511 2016-10-01 20:52
    最佳回答

    Remove "vendor/autoload.php" from autoload>classmap

    "autoload": {
        "classmap": [
            "database",
            "app/Facades",
            "app/Services",
            "vendor/autoload.php"
        ],
    
    评论
    解决 无用
    打赏 举报
查看更多回答(1条)

相关推荐 更多相似问题