Valet: zsh: command not found: laravel

Created on 3 Sep 2017  路  11Comments  路  Source: laravel/valet

I installed valet, and followed the documentation, composer is in my $PATH, everything is ok. But when I try to run

laravel new blog

I get

zsh: command not found: laravel

In my .zshrc I have

export PATH="$HOME/.composer/vendor/bin:$PATH"

And when I echo $PATH I have

/Users/dingo-d/.composer/vendor/bin:/usr/local/sbin:/Users/dingo-d/wpcs/vendor/bin:/Users/dingo-d/.rbenv/shims:/Users/dingo-d/.rbenv/bin:/Users/dingo-d/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin

I restarted terminal, mac, everything I could google, but cannot see what could be wrong.

All the commands in the terminal are working (composer and valet), I have successfully parked the folder Sites and when I type valet paths I get

```sh
[
"/Users/infinum/Sites"
]
````

The composer version is 1.5.1, valet version is 2.0.5, php is 7.1.8 and the OS X is version 10.12.6.

I also have VVV installed but it's stopped.

Any ideas why it isn't running?

Most helpful comment

My solution was:

  • Add PATH="$HOME/.config/composer/vendor/bin:$PATH" at end of ~/.zshrc
  • source ~/.zshrc
  • type laravel and be happy =)

All 11 comments

It would seem as though perhaps you're expecting the Laravel Installer to be present on your computer, but haven't installed it.

composer global require laravel/installer

The Laravel Installer is completely separate from Laravel Valet. You can find documentation on using the Laravel Installer in the Laravel documentation.

Oh I thought that valet pulls it, and I had bunch of laravel packages listed when I did composer show --all, my bad. Thanks for the help!

Better is to run: composer global show to list all that are installed on your local computer.

Cool, didn't know that :D Thanks :+1:

Also just an FYI, this is not a valet issue.

Well it happened while I was trying to set up valet, so I thought that I'd ask here ;)

I have this problem, however, laravel works fine while valet does not. I have already installed valet as per documentation. Running valet returns sudo: /Users/myuser: command not found

Running composer global show gives me:

guzzlehttp/guzzle 6.3.0 Guzzle is a PHP HTTP client library
guzzlehttp/promises v1.3.1 Guzzle promises library
guzzlehttp/psr7 1.4.2 PSR-7 message implementation that also pr...
illuminate/container v5.5.2 The Illuminate Container package.
illuminate/contracts v5.5.2 The Illuminate Contracts package.
laravel/installer v1.4.1 Laravel application installer.
laravel/valet v2.0.5 A more enjoyable local development experi...
mnapoli/silly 1.6.0 Silly CLI micro-framework based on Symfon...
nategood/httpful 0.2.20 A Readable, Chainable, REST friendly, PHP...
php-di/invoker 2.0.0 Generic and extensible callable invoker
psr/container 1.0.0 Common Container Interface (PHP FIG PSR-11)
psr/http-message 1.0.1 Common interface for HTTP messages
psr/log 1.0.2 Common interface for logging libraries
psr/simple-cache 1.0.0 Common interfaces for simple caching
symfony/console v3.3.8 Symfony Console Component
symfony/debug v3.3.8 Symfony Debug Component
symfony/filesystem v3.3.8 Symfony Filesystem Component
symfony/polyfill-mbstring v1.5.0 Symfony polyfill for the Mbstring extension
symfony/process v3.3.8 Symfony Process Component
tightenco/collect v5.4.33 Collect - Illuminate Collections as a sep...

I have this in my .zshrc for composer:

export PATH=$HOME/bin:/usr/local/bin:~/.composer/vendor/bin:$PATH

Had this exact same problem and the fix was the same as @drbyte said, the only change was using require instead of install: composer global require laravel/installer. This is because the valet install documentation doesn't state to do this, so every user who didn't install laravel beforehand is going to have this problem. The docs should be updated to state this.

@MiguelDebruyne The Laravel Installer is completely separate from Laravel Valet. You can find documentation on using the Laravel Installer in the Laravel documentation.

It is not necessary to install the Laravel Installer in order to run Valet. Nor is it necessary to install Valet to use the Laravel Installer.

My solution was:

  • Add PATH="$HOME/.config/composer/vendor/bin:$PATH" at end of ~/.zshrc
  • source ~/.zshrc
  • type laravel and be happy =)

My solution was:

* Add `PATH="$HOME/.config/composer/vendor/bin:$PATH"` at end of `~/.zshrc`

* `source ~/.zshrc`

* type `laravel` and be happy =)

worked well for me. Looking for this almost two days now

Was this page helpful?
0 / 5 - 0 ratings

Related issues

marianvlad picture marianvlad  路  5Comments

LucidNinja picture LucidNinja  路  4Comments

TimOgilvy picture TimOgilvy  路  3Comments

idmahbub picture idmahbub  路  3Comments

ellisio picture ellisio  路  4Comments