gpt4 book ai didi

node.js - 在 Elastic Beanstalk 上通过 .ebextensions 安装 git

转载 作者:搜寻专家 更新时间:2023-10-31 22:22:47 27 4
gpt4 key购买 nike

我在部署到 Elastic Beanstalk 时遇到错误,因为实例上没有 git。我的 package.json 中的依赖项之一依赖于 git 存储库,需要 git clone。实例上未安装 Git。我尝试在部署时通过 .ebextensions .conf 文件通过 yum 安装它,但是当我通过 ssh 进入实例时它不存在。

问题是:在 Elastic Beanstalk 上运行的 Linux 实例上调用 npm install 之前,在该实例上安装和使用 git 的正确方法是什么?

这是显示错误的日志:

[2015-04-18T09:00:02.815Z] ERROR [1777]  : Command execution failed: Activity failed. (ElasticBeanstalk::ActivityFatalError)
caused by: + /opt/elasticbeanstalk/containerfiles/ebnode.py --action npm-install
npm WARN package.json amity-api-v2@2.0.0 No repository field.
npm WARN package.json amity-api-v2@2.0.0 No README data
npm WARN `git config --get remote.origin.url` returned wrong result (https://github.com/awslabs/dynamodb-document-js-sdk) undefined
npm WARN `git config --get remote.origin.url` returned wrong result (https://github.com/awslabs/dynamodb-document-js-sdk) undefined
npm ERR! git clone https://github.com/awslabs/dynamodb-document-js-sdk undefined
npm ERR! git clone https://github.com/awslabs/dynamodb-document-js-sdk undefined
npm ERR! Linux 3.14.35-28.38.amzn1.x86_64
npm ERR! argv "/opt/elasticbeanstalk/node-install/node-v0.12.0-linux-x64/bin/node" "/opt/elasticbeanstalk/node-install/node-v0.12.0-linux-x64/bin/npm" "--production" "install"
npm ERR! node v0.12.0
npm ERR! npm v2.5.1
npm ERR! code ENOGIT

npm ERR! not found: git
npm ERR!
npm ERR! Failed using git.
npm ERR! This is most likely not a problem with npm itself.
npm ERR! Please check if you have git installed and in your PATH.

最佳答案

如果您像这样将配置文件放在 .ebextensions 文件夹中:

packages:
yum:
git: []

确保 git 包位于执行索引高于实际需要 git 的配置文件中。通常将它放在名为:00-packages.config 的第一个配置文件中。

关于node.js - 在 Elastic Beanstalk 上通过 .ebextensions 安装 git,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29724902/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com