Saturday, March 11, 2017

"laravel" command on Homestead 2 doesn't work

I am running homestead 2.0, and when I run laravel new command, it throws an error.

vagrant@homestead:/home/Code$ laravel new lproject
laravel: command not found

I did install laravel globally:

vagrant@homestead:/home/Code$ composer global require "laravel/installer"
Changed current directory to /home/vagrant/.config/composer
You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug
Using version ^1.3 for laravel/installer
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Removing laravel/installer (v1.3.4)
  - Installing laravel/installer (v1.3.5)
    Downloading: 100%         

Writing lock file
Generating autoload files

My path already includes ~/.composer/vendor/bin.

vagrant@homestead:/home/Code$ echo $PATH
∼/.composer/vendor/bin:~/.composer/vendor/bin:/root/.composer/vendor/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/vagrant/.composer/vendor/bin

Still laravel command fails.

vagrant@homestead:/home/Code$ laravel
-bash: /home/vagrant/.composer/vendor/bin/laravel: No such file or directory



via Santosh Achari

Advertisement