I found the solution after i tried many many times. First, check your actual path to the laravel installer. You need to go to /home/(here is your name)/.config/composer/vendor/bin
... to check if it really exist that path. In the beginning i got the 'laravel command not found' and 'bash: /home/eduard/.composer/vendor/bin/laravel: No such file or directory', so i checked if the path was correct, and it really wasn't, my path was /home/eduard/.config/composer/vendor/bin
, i was different from any paths i found on internet. After composer global require "laravel/installer=~1.1"
, the solution is:
- go using the terminal to the path to see if it's different, until you find
/bin
. So, go to /home/(here you put your name)/.config/composer/vendor/bin
(this is my path), and remember the path.
- then in terminal,
cd ~
, and then sudo nano .bashrc
scroll down to the ending of the file and add:
export PATH="$PATH:~/.config/composer/vendor/bin"
alias laravel='~/.config/composer/vendor/bin/laravel'
(!! important: keep in mind that your path may be a little bit different, make sure that the path exist like in step 1, if it's a little bit different then change it as it's your).
- press Ctrl + X, then Y and Enter, to save changes.
- refresh changes with
source ~/.bashrc
- enter
laravel
in terminal to see if everything is ok.
Keep in mind that your path may be different from any on the web, make sure that your the path it's correct, check it, and put the right one as I did. I'm using Ubuntu 16, but the solution I think is similar for any version, as long as you put your correct path.