darroosh
darroosh

Reputation: 831

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?

Upvotes: 39

Views: 87102

Answers (8)

Fede
Fede

Reputation: 1

In my case i was writing larabel when it's laravel. I say this because maybe the same thing happens to someone.

Upvotes: 0

developerrakib
developerrakib

Reputation: 49

This problem is happening few many reasons like wrong installation path and conflicts with previous project creation. To solve this problem first: composer global require laravel/installer then: laravel new admin ProjectName

Upvotes: 1

this command has solved my problem.

composer global require "laravel/installer=~1.1"

Upvotes: -2

Emmanuel Adebayo
Emmanuel Adebayo

Reputation: 255

First, use:

composer global require "laravel/installer=~1.1"

Then, you can try again.

laravel new project

Upvotes: 4

HigherOrderMalfunction
HigherOrderMalfunction

Reputation: 170

You need to install Laravel using

composer global require laravel/installer

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

Upvotes: 15

gsiradze
gsiradze

Reputation: 4733

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

Upvotes: 22

Alireza
Alireza

Reputation: 1764

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

Upvotes: 52

Mantas D
Mantas D

Reputation: 4150

Use correct path to the Composer bin directory.

Good:

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

Bad:

~/.composer/vendor/bin

Upvotes: 54

Related Questions