简体   繁体   中英

Laravel error when using composer to setup

I am a php beginner. I got some problem when using composer to initially extend the project. Your kindness would be highly appreciate.

Hereby is the trace infomation and composer.jason.

Stack trace:
#0 C:\Users\jim\git\laravel\vendor\laravel\framework\src\Illuminate\Container\Container.php(809): ReflectionClass->__construct()
#1 C:\Users\jim\git\laravel\vendor\laravel\framework\src\Illuminate\Container\Container.php(691): Illuminate\Container\Container->build()
#2 C:\Users\jim\git\laravel\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(796): Illuminate\Container\Container->resolve()
#3 C:\Users\jim\git\laravel\vendor\laravel\framework\src\Illuminate\Container\Container.php(269): Illuminate\Foundation\Application->resolve()
#4 C:\Users\jim\git\laravel\vendor\laravel\framework\src\Illuminate\Container\Container.php(805): Illuminate\Container\Container->Illuminate\Container\{closure}()
#5 C:\Users\jim\git\laravel\vendor\laravel\framework\src\Illuminate\Container\Container.php(691): Illuminate\Container\Container- in C:\Users\jim\git\laravel\vendor\laravel\framework\src\Illuminate\Container\Container.php on line 811
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 255

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": [
        "framework",
        "laravel"
    ],
    "license": "MIT",
    "require": {
        "php": "^7.2.5",
        "fideloper/proxy": "^4.2",
        "fruitcake/laravel-cors": "^2.0",
        "guzzlehttp/guzzle": "^6.3",
        "laravel/framework": "^7.24",
        "laravel/tinker": "^2.0"
    },
    "require-dev": {
        "facade/ignition": "^2.0",
        "fzaninotto/faker": "^1.9.1",
        "mockery/mockery": "^1.3.1",
        "nunomaduro/collision": "^4.1",
        "phpunit/phpunit": "^8.5"
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/"
        },
        "classmap": [
            "database/seeds",
            "database/factories"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ]
    }
}

I try to track the exception and found error indicator in app.php

Had this error once. Your project may be missing an app name.

Run:

php artisan app:name <name>

Or just write it in the top of your .env file:

APP_NAME= <your app name>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM