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 so the laravel executable is found when you run the laravel command in your terminal.
I don't understand what I should do ?
I added ~/.composer/vendor/bin
to my system variables, and then tried using 'laravel new blog' in the command line but got the following message :
laravel is not recognized as an internal or external command
what should I do?
To solve the error "mix is not recognized as an internal or external command, operable program or batch file", open your terminal in your project's root directory and install the laravel-mix package by running npm install --save-dev laravel-mix@latest .
The most efficient way to fix the “is not recognized as an internal command” error is to edit your environment variable and add the appropriate file path there. This is because the Command Prompt utility looks at those paths when you enter a command, and then opens the file if it finds it in one of those directories.
# Add Environment Path System variables – If we add a path in system variables then other system users also use the PHP though command line. User variables – If we set the path for the current user then only current user can execute the PHP though command line.
The “not recognized as internal command” error usually occurs because the computer cannot find the executable file it is trying to start. However, you can provide the full path to your executable and then it should run without any problem. Launch a Command Prompt window on your PC.
Use correct path to the Composer bin
directory.
Good:
%USERPROFILE%\AppData\Roaming\Composer\vendor\bin
Bad:
~/.composer/vendor/bin
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
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