Bower安装在ElasticBeanstalk上失败 - 无法找到GIT

时间:2015-12-17 12:12:19

标签: git bower elastic-beanstalk amazon-elastic-beanstalk

我试图将应用程序部署到使用bower下载某些库的弹性beanstalk上。我在部署时收到以下错误:

ERROR: [Instance: i-b4b8893d] Command failed on instance. Return code: 1 Output: bower jquery.cookie#~1.4.1      ENOGIT git is not installed or not in the PATH. 
container_command 04_bower_install in .ebextensions/01-flask.config failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.

这是我的配置文件:

option_settings:
  "aws:elasticbeanstalk:container:python":
    WSGIPath: "app.py"
  "aws:elasticbeanstalk:container:python:staticfiles":
    "/static/": "static/"
packages:
  yum:
    libjpeg-turbo-devel: []
    libpng-devel: []
    freetype-devel: []
    git: []
commands:
  01_set_home:
    command: export HOME=/home/ec2-user
  02_get_sudo:
    command: echo Defaults:root \!requiretty >> /etc/sudoers 
  03_npm_install:
    command: sudo yum -y --enablerepo=epel install nodejs npm
  04_npm_install_bower:
    command: sudo npm install -g bower
container_commands:
  01_set_path:
    command: export PATH=$PATH
  02_set_home:
    command: export HOME=/home/ec2-user
  03_set_git:
    command: export ENOGIT=/usr/bin/git
    command: export GIT=/usr/bin/git
  04_bower_install:
    command: 'bower --allow-root install'
    env:
      HOME: /home/ec2-user
      ENOGIT: /usr/bin/git
      GIT: /usr/bin/git

从我的谷歌搜索,人们建议确保安装git,所以我将它添加到包> yum指令,确保导出PATH变量以及GIT变量。正如你所看到的,我已经尝试了所有这些,并没有修复错误。

有什么想法吗? 谢谢 Max Mumford。

1 个答案:

答案 0 :(得分:1)

修正了它:

  04_bower_update:
    command: "bower update --allow-root"
    env:
      "PATH": "/usr/bin"