5

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.

4
  • Are you trying to run this in a WAMP setup? I could imagine that would produce some issue if that's the case. Commented Jan 29, 2016 at 7:37
  • i run this in Command Prompt, with %USERPROFILE%\AppData\Roaming\Composer\vendor\bin had been set to the PATH. Commented Jan 29, 2016 at 7:55
  • You should consider trying and running this inside a virtual environment. Take a look at this site: fideloper.github.io/Vaprobash Commented Jan 29, 2016 at 7:56
  • try composer self-update and composer global update Commented Jan 29, 2016 at 8:35

1 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.