Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zsh: command not found: laravel #429

Closed
dingo-d opened this issue Sep 3, 2017 · 13 comments
Closed

zsh: command not found: laravel #429

dingo-d opened this issue Sep 3, 2017 · 13 comments

Comments

@dingo-d
Copy link

dingo-d commented Sep 3, 2017

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

[
    "/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?

@drbyte
Copy link
Contributor

drbyte commented Sep 3, 2017

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.

@dingo-d
Copy link
Author

dingo-d commented Sep 4, 2017

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!

@dingo-d dingo-d closed this as completed Sep 4, 2017
@drbyte
Copy link
Contributor

drbyte commented Sep 4, 2017

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

@dingo-d
Copy link
Author

dingo-d commented Sep 4, 2017

Cool, didn't know that :D Thanks 👍

@joshmanders
Copy link
Contributor

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

@dingo-d
Copy link
Author

dingo-d commented Sep 5, 2017

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

@emmandev
Copy link

emmandev commented Sep 6, 2017

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

@MiguelDebruyne
Copy link

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.

@drbyte
Copy link
Contributor

drbyte commented May 14, 2020

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

@oviniciusfeitosa
Copy link

My solution was:

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

@kevinwaxi
Copy link

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

@inimist
Copy link

inimist commented Apr 5, 2023

As of now (2023) the locations of composer executables may have changed. So instead use:

export PATH=~/.composer/vendor/bin:$PATH
source ~/.zshrc
laravel

@AngelCookies
Copy link

As of now (2023) the locations of composer executables may have changed. So instead use:

export PATH=~/.composer/vendor/bin:$PATH source ~/.zshrc laravel

6th December 2023

If your a Manjaro user 'PATH="$HOME/.config/composer/vendor/bin:$PATH"' works correctly test 3 times above does work on Ubuntu and other deb based distros

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants