mfathirirhas
mfathirirhas

Reputation: 2287

Error when creating Laravel 5 project

I know there are 2 ways to create a new project in Laravel. One is using composer create-project laravel/laravel _projectname_ and another is using laravel new _projectname_. I tried to create a project using the first one with Composer, and there is no problem with it. But when I tried to create with the second one using laravel new, it returned this error:

$ laravel new _projectname_
    Crafting application...
    > php -r "copy('.env.example', '.env');"
    > php artisan clear-compiled
    Script php artisan clear-compiled handling the post-install-cmd  
    event returned with an error


      [RuntimeException]
      Error Output:


    run-script [--dev] [--no-dev] [-l|--list] [--] [<script>] [<args>]...

    Application ready! Build something amazing. 

I used Windows as OS and I've set the environment PATH for %USERPROFILE%\AppData\Roaming\Composer\vendor\bin in PATH, and it works when I try the laravel commend in the command prompt. I've always used the laravel new _projectname_ before and it worked. I think I changed nothing, but it doesn't work anymore and I don't know why. How could that be? Any help would be appreciated. Thanks.

Upvotes: 5

Views: 272

Answers (1)

mfathirirhas
mfathirirhas

Reputation: 2287

I've found the answer, i got from this https://laracasts.com/discuss/channels/general-discussion/cant-use-laravel-new-app-name. Update your laravel using composer global require "laravel/installer" . After it finished, tried to run laravel new _projectname_, it update all dependencies and it works for me. Hope it helps.

Upvotes: 3

Related Questions