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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With