jeo*_*cha 11 amazon-web-services node.js amazon-elastic-beanstalk nestjs
我有一个 Nest.js (Node.js) 应用程序,我想将其部署在 ElasticBeanstalk(Node 16 版本,AL2 5.5.0)上。我的部署一直失败,我在eb-engine.log.
...
2022/03/23 15:11:48.570759 [INFO] Executing instruction: StageApplication
2022/03/23 15:11:48.570846 [INFO] extracting /opt/elasticbeanstalk/deployment/app_source_bundle to /var/app/staging/
2022/03/23 15:11:48.570860 [INFO] Running command /bin/sh -c /usr/bin/unzip -q -o /opt/elasticbeanstalk/deployment/app_source_bundle -d /var/app/staging/
2022/03/23 15:11:49.274806 [INFO] finished extracting /opt/elasticbeanstalk/deployment/app_source_bundle to /var/app/staging/ successfully
2022/03/23 15:11:49.289272 [INFO] Executing instruction: RunAppDeployPreBuildHooks
2022/03/23 15:11:49.289292 [INFO] Executing platform hooks in .platform/hooks/prebuild/
2022/03/23 15:11:49.289306 [INFO] The dir .platform/hooks/prebuild/ does not exist
2022/03/23 15:11:49.289311 [INFO] Executing instruction: Install customer specified node.js version
2022/03/23 15:11:49.289314 [INFO] installing specified nodejs version...
2022/03/23 15:11:49.289467 [INFO] there is no nodejs version specified in package.json, skip installing specified version of nodejs
2022/03/23 15:11:49.289476 [INFO] Executing instruction: Use NPM to install dependencies
2022/03/23 15:11:49.289484 [INFO] use npm to install dependencies
2022/03/23 15:11:49.289505 [INFO] Running command /bin/sh -c npm config set jobs 1
2022/03/23 15:11:49.574486 [INFO] Running command /bin/sh -c npm --production install
2022/03/23 15:12:06.913580 [ERROR] An error occurred during execution of command [app-deploy] - [Use NPM to install dependencies]. Stop running the command. Error: Command /bin/sh -c npm --production install failed with error signal: killed
...
Run Code Online (Sandbox Code Playgroud)
我认为在生产模式下安装 npm 包时会发生错误,但我真的很想知道为什么会发生这种情况。我npm --production install在本地计算机上执行,使用完全相同版本的node和npm安装成功。(目前最新的是 Node 16.14.0、npm 8.3.1 - AL2 5.5.0)。
我想知道为什么会发生这种情况以及如何调试更多细节(为什么npm install在elastic beanstalk环境中失败)。