简体   繁体   English

AWS EB (Elastic Beanstalk) CLI 在 git bash 的命令行中不工作

[英]AWS EB ( Elastic Beanstalk) CLI not working in the command line of git bash

AWS EB (Elastic Beanstalk) CLI not running in git bash (Windows 10). AWS EB (Elastic Beanstalk) CLI 未在 git bash (Windows 10) 中运行。 I have successfully installed the AWS EB CLI from AWS documentation at https://github.com/aws/aws-elastic-beanstalk-cli-setup/blob/master/README.md .我已经从位于https://github.com/aws/aws-elastic-beanstalk-cli-setup/blob/master/README.md的 AWS 文档成功安装了 AWS EB CLI。 At the end I have set the environment variables as mentioned in the doc.最后我设置了文档中提到的环境变量。 So "eb" command is working from Windows Power shell. But when I am trying to access the "eb" command from GIT Bash / IntelliJ bash prompt, it is not working.所以“eb”命令从 Windows Power shell 运行。但是当我试图从 GIT Bash / IntelliJ bash 提示访问“eb”命令时,它不起作用。

Working fine with windows power shell:使用 windows 电源 shell 工作正常:

PS C:\> eb --version
EB CLI 3.19.2 (Python 3.7.3) 

Environment variable set as below under "User Variable" -> "Path":在“用户变量”->“路径”下设置如下环境变量:

Environment variable set windows环境变量集 windows

While trying to access the "eb" from Git Bash the error is as below:尝试从 Git Bash 访问“eb”时,错误如下:

$ eb
bash: eb: command not found

$ echo $PATH
.....
......
/c/Users/xxxxxx/.ebcli-virtual-env/executables:

Restarted the system and commandline interfaces multiple time.多次重新启动系统和命令行界面。

Can someone please let me know if there are some issue with environment variable set, or need to configure something additional in bash environment?如果环境变量设置有问题,或者需要在 bash 环境中配置一些额外的东西,有人可以告诉我吗?

After so many trial and error with different solution available in inte.net along with AWS doc suggestion, finally I can use "eb" from Git bash of windows 10. The problem fixed after I put the below location in my environment variable path:在使用 inte.net 中可用的不同解决方案以及 AWS 文档建议进行了如此多的尝试和错误之后,我终于可以使用来自 Git bash of windows 10 的“eb”。将以下位置放入我的环境变量路径后,问题得到解决:

C:\Users\XXXX\AppData\Roaming\Python\Python37\Scripts C:\Users\XXXX\AppData\Roaming\Python\Python37\Scripts

The issue for me was a username with a space.对我来说,问题是带空格的用户名。 The path would then look like this: C:\Users\fname lastname.ebcli-virtual-env\executables.路径将如下所示:C:\Users\fname lastname.ebcli-virtual-env\executables。 The problem came about with the.bat files created by the AWS script did not wrap the path in double quotes.问题出在 AWS 脚本创建的 .bat 文件没有用双引号括起路径。 Windows then interprets it as multiple parameters. Windows 然后将其解释为多个参数。

I had to go edit eb.bat and path_exporter.bat and wrap the directives like this: (in eb.bat) CALL "C:\Users\fname lastname.ebcli-virtual-env\Scripts\activate.bat" @start CALL "C:\Users\fname lastname.ebcli-virtual-env\Scripts\eb.exe" %args% The EB cli seems to work properly now.我必须 go 编辑 eb.bat 和 path_exporter.bat 并像这样包装指令:(在 eb.bat 中)CALL "C:\Users\fname lastname.ebcli-virtual-env\Scripts\activate.bat" @start CALL "C:\Users\fname lastname.ebcli-virtual-env\Scripts\eb.exe" %args% EB cli 现在似乎可以正常工作。

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

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