Search code examples
laravellaravel-5composer-phplaravel-5.5

How to solve php artisan key generate error?


I created a new Laravel 5.5 project with this command:

laravel new crud-angular

After then, run this command inside the project folder:

php artisan key:generate

At that moment, I got such error:

Warning: require(F:\Study\Laravel\crud-angular/vendor/autoload.php): failed to open stream: No such file or directory in F:\Study\Laravel\crud-angular\artisan on line 18

Fatal error: require(): Failed opening required 'F:\Study\Laravel\crud-angular/vendor/autoload.php' (include_path='.;C:\php\pear') in F:\Study\Laravel\crud-angular\artisan on line 18

I used wampserver 3.0.6 for this project. Hope to help me. Thanks


Solution

  • Make sure you have run:

    composer install
    

    Now it seems packages are not installed. If they are, try running:

    composer dump-autoload