Could not open input file: artisan

后端 未结 27 923
清歌不尽
清歌不尽 2020-11-30 17:45

When trying to create a new laravel project, The following error appears on the CLI:

Could not open input file: artisan

Script php artisan clear-c

相关标签:
27条回答
  • 2020-11-30 18:19

    After struggling with this issue, I found out that you need to find where artisan resides by running sudo find / -name artisan, and from there run the command php artisan ....

    0 讨论(0)
  • 2020-11-30 18:19

    First go to the Laravel folder then type the artisan commands like if your Laravel app name "Demopro"

    so open cmd and with the help of cd command go in the Demopro and then use artisan command

    0 讨论(0)
  • 2020-11-30 18:22

    Just make sure you are in the project folder by typing

    ls

    If not then go to the project folder by typing

     cd folder_name
    

    for example:

    cd laravel
    

    And then type

    php artisan serve

    0 讨论(0)
  • 2020-11-30 18:22

    Try executing it as sudo.

    sudo laravel new blog

    Your file may not have the appropriate permissions. Let us know if it worked!

    0 讨论(0)
  • 2020-11-30 18:24

    I checked out an existing Laravel project, which did not have this script. Even a find / -name 'artisan' produced no results. The solution turned out to be simple, if a bit weird:

    curl -L 'https://raw.githubusercontent.com/laravel/laravel/v4.2.11/artisan' > artisan
    

    You probably want to choose a tagged version that matches your installed version of Laravel.

    0 讨论(0)
  • 2020-11-30 18:24

    -> cd ..

    -> cd project_dir

    -> php artisan ('works fine')

    in my case, i removed the directory and again clone the repo from the same directory through terminal. then i went one step back and step into my project folder again and the problem was gone.

    0 讨论(0)
提交回复
热议问题