Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 648
D. Sean Avatar asked Dec 04 '22 20:12

D. Sean


2 Answers

Make sure you have run:

composer install

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

composer dump-autoload
like image 74
Marcin Nabiałek Avatar answered Dec 11 '22 15:12

Marcin Nabiałek


Try to to give permission for that vendor folder

sudo chmod -R 777 vendor

update your composer also

composer update

this will fix your issue

like image 41
Sivaraju Mani Avatar answered Dec 11 '22 16:12

Sivaraju Mani