【发布时间】:2016-02-06 18:46:21
【问题描述】:
我想使用 eb deploy 命令在 Amazon Elastic Beanstalk 中部署我的 PHP 应用程序。但我的应用使用 gulp 来连接和缩小 scss 和 js。
所以我在文件.ebextensios/03npm.config中尝试了这些命令
commands:
01-install-node:
command: "yum install nodejs npm --enablerepo=epel -y"
container_commands:
01-install-dependencies:
command: "npm install"
02-build:
command: "npm run build"
但最后我收到了这个错误
[Instance: i-c7800103] Command failed on instance. Return code: 1 Output: (TRUNCATED)...ttps://registry.npmjs.org/acorn npm http 304 https://registry.npmjs.org/amdefine npm http 304 https://registry.npmjs.org/wrappy npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /var/app/ondeck/npm-debug.log npm ERR! not ok code 0. container_command 01-install-dependencies in .ebextensions/03npm.config failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
我不确定,但似乎npm install 从一个可以忽略的包中收到错误,但它正在调度 EB 错误并停止整个过程。
我正在使用这台机器运行:64bit Amazon Linux 2015.09 v2.0.4 running PHP 5.6
有谁知道我们如何解决这个问题?
【问题讨论】:
-
我遇到了同样的问题。
.ebextensions中几乎相同的 .config 文件。你找到解决方案了吗,如果有,你愿意分享吗?谢谢。 -
我在 anwser 中发布我的解决方案以便更好地解释它
-
我昨天遇到了同样的问题,但不喜欢任何答案,在日志中找到了原因。具体来说,您想查看
eb-activity.log和eb-commandprocessor.log以获得有关此错误的更多信息。我发现我的与我的 npm 安装本身有关。所以这不是eb本身的问题,我修复了那个简单的 npm 错误,然后继续前进。希望这些信息对那里的人有所帮助=)
标签: node.js amazon-web-services amazon-ec2 npm lampp