简体   繁体   English

使用laravel命令时找不到laravel命令

[英]laravel command not found while using laravel command

I've recently installed composer and also installed laravel installer from composer from the commmand line just like they said in laravel documentation. 我最近安装了composer,并且也从commmand行的composer安装了laravel安装程序,就像他们在laravel文档中所说的那样 But when I used the laravel command on the command line, it show error: 但是,当我在命令行上使用laravel命令时,它显示错误:

sh.exe": laravel: command not found

I also added environment variable in the path variable. 我还在路径变量中添加了环境变量。

~/.composer/vendor/bin

But still the same error occurs while using the laravel command. 但是使用laravel命令时仍然会发生相同的错误。 I'm a laravel newbie and I'm stuck in laravel installation.I've searched lot of times but still could not get the solution. 我是laravel新手,被困在laravel安装中。我已经搜索了很多次,但仍然找不到解决方案。 I've read lot of users' questions with the same problem and used their solutions but still could not fix this. 我已经阅读了许多用户关于相同问题的问题,并使用了他们的解决方案,但仍然无法解决此问题。

Your path /c/xampp/php:~/.composer/vendor/bin is definitly wrong. 您的路径/c/xampp/php:~/.composer/vendor/bin是错误的。 Either you have to fix it (should be something like C:/{path_to_your_composer_directory} ) or you can simply use composer create-project laravel/laravel --prefer-dist to install a new laravel project. 您必须对其进行修复(应该是C:/{path_to_your_composer_directory} ),也可以只使用composer create-project laravel/laravel --prefer-dist安装一个新的laravel项目。

I would go with the 2nd option, because you don't have to configure something else. 我会选择第二个选项,因为您不必配置其他内容。

On windows system, please remove . 在Windows系统上,请删除. from path (just before .Composer ) 从路径(就在.Composer之前)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM