framework: "Whoops, looks like something went wrong." on brand new project
- Laravel Version: 5.5
- PHP Version: PHP 7.0.22-0ubuntu0.17.04.1
Description:
Updated laravel to 5.5 via composer global update. Created a new project using laravel new foo
Ran php artisan foo
Moving .env.example to .env and running php artisan key:generate makes the error go away.
And when creating a new project I see the following in my terminal:
Generating optimized autoload files
You made a reference to a non-existent script @php -r "file_exists('.env') || copy('.env.example', '.env');"
You made a reference to a non-existent script @php artisan key:generate
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
You made a reference to a non-existent script @php artisan package:discover
Application ready! Build something amazing.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 9
- Comments: 20 (4 by maintainers)
Hey @ikayyuddie try to find file .env in your project laravel. I have the same problem, thats the problem why its still doesn’t work. Because .env file just gone, i don’t know how it’s gone. you just copy .env file from another project, and change .env file as you need
I found running
composer global updateas solution for this issue, but actually runningcomposer global self-updatesolved the issue for merename
.env.exampleas.env. Open it and update the data (especially Database config)I had the same issue. I got the error because the missing .env file
Browse the issues. Same question has been asked several times in the last 24 hours.
This is because of your Laravel Installer or Composer version. I have faced the same problem and found following 2 different solutions:
Generally you can solve with by running
composer global updatecommand and then runcomposer updatecommand from your project directory. This solution basically updates your installer and then your project.If still, you have this issue, you need to run
composer self-updatecommand first and then runcomposer updatecommand from your project directory. Here your composer will update and then your project.Hope this answer will help you.
#20864 #20831 #20843
Looks like you just need to update your global composer dependencies so that laravel installer gets updated.