bash:宅基地:找不到命令 [英] bash: homestead: command not found

查看:63
本文介绍了bash:宅基地:找不到命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装了宅基和laravel,但是当我在命令行中编写命令时却出现了错误,但laravel和homestead都找不到该命令,所以我进行了很多搜索,发现必须添加路径,所以我以传出的方式添加了仍然找不到相同的错误命令.这是我的bash个人资料,添加路径时有什么错误吗?

I install homestead and laravel but when i write the command in command line there is error the command not found for both laravel and homestead so i search a lot and i found that i must add the path so i added in efferent way but still the same error command not found. and this is my bash profile is there any wrong when i added the path?

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/.local/bin:$HOME/bin

export PATH
export composer=php /usr/bin/composer.phar
export PATH=~/.composer/vendor/bin/:$PATH:/home/alsachit/.composer

推荐答案

您应该从Laravel项目目录运行Laravel命令,例如 php artisan composer .如果您将在其他目录中运行命令,则可能会遇到很多错误(很多人因此而寻求帮助),所以我的建议是保持简单.

You should run Laravel commands from Laravel project directory, like php artisan or composer. If you will run there commands from other directories, you can meet a lot of errors (a lot of guys ask for help on SO because of it), so my advice is to keep it simple.

更新:

COMPOSER_PATH=~/.composer/vendor/bin
PATH=$COMPOSER_PATH:$PATH
export PATH

另一种可能适合您的方法:

Another way which may work for you:

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

这篇关于bash:宅基地:找不到命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆