laravel is not recognized as an internal or external command

后端 未结 5 1550
梦谈多话
梦谈多话 2021-02-01 15:55

I\'m trying to start laravel,

Found the following line in their tutorial:

Make sure to place the ~/.composer/vendor/bin directory in your PATH

相关标签:
5条回答
  • 2021-02-01 15:57

    For me after adding PATH to environment variables result was the same. I found me answer here

    So at first you have to run in cmd

    composer global require "laravel/installer=~1.1"
    

    and then the message appears

    " Changing directory to C:\Users\USER\AppData\Roaming\Composer\vendor\bin "

    and after that you can run your command. For example

    laravel new blog
    
    0 讨论(0)
  • 2021-02-01 15:58

    Use correct path to the Composer bin directory.

    Good:

    %USERPROFILE%\AppData\Roaming\Composer\vendor\bin
    

    Bad:

    ~/.composer/vendor/bin
    
    0 讨论(0)
  • 2021-02-01 15:59

    First, use:

    composer global require "laravel/installer=~1.1"
    

    Then, you can try again.

    laravel new project
    
    0 讨论(0)
  • 2021-02-01 16:01

    For Windows add

    C:\Users\MyUserName\AppData\Roaming\Composer\vendor\bin 
    

    ... to directory by going to "My Computer" > "Properties" > "Advanced" > "Environment > Variables" > "Path".

    Note: MyUserName is your pc username .

    Restart your PC and it would work

    0 讨论(0)
  • 2021-02-01 16:04

    You need to install Laravel using

    composer global require laravel/installer
    

    Otherwise, even adding it to PATH won't help.

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