Reputation: 1308
I'm trying to use Laravel 5.5. I updated my php 7.0 to php 7.1. Even, I update my laravel installer package. But, when I try to do:
laravel new myProject
I get this error:
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
I am using laravel valet and if I go to the browser, when I try myProject.dev is not working. I see this error:
Whoops, looks like something went wrong.
I tried using:
php artisan key:generate
inside my project, but I got that:
[ErrorException]
file_get_contents(/Users/jorgeJimenez/Sites/laravel5-5/.env): failed to ope n stream: No such file or directory
I noticed, my laravel 5.4 projects are working. I copied a .env file and I put on my laravel 5.5 projects. After that, I run
php artisan key:generate
and the key was generated and my project in the browser works. It's supposed, all that process is automatic, but I am not quite sure what is happening.
Upvotes: 3
Views: 3774
Reputation: 1242
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 update
command and then run composer update
command 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-update
command first and then run composer update
command from your project directory. Here your composer will update and then your project.
Hope this answer will help you.
Upvotes: 0
Reputation: 1
I had the same problem. Then I found that there was no problem when i created the first project use laravel 5.5. so I clear composer's cache dir. It works well now.
Upvotes: 0