Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

laravel is not recognized as an internal or external command

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?

like image 808
darroosh Avatar asked Aug 27 '14 13:08

darroosh


People also ask

Is not recognized as an internal or external command laravel?

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 .

How do you fix is not recognized as an internal or external command?

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.

How do you fix PHP is not recognized as an internal or external command?

# 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.

Why it is showing it is not recognized as internal or external command?

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.


2 Answers

Use correct path to the Composer bin directory.

Good:

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

Bad:

~/.composer/vendor/bin 
like image 165
Mantas D Avatar answered Sep 29 '22 00:09

Mantas D


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

like image 23
Alireza Aboutalebi Avatar answered Sep 28 '22 23:09

Alireza Aboutalebi