gpt4 book ai didi

json - Elastic Beanstalk 在启动脚本时失败

转载 作者:太空宇宙 更新时间:2023-11-03 21:53:23 25 4
gpt4 key购买 nike

我正在尝试将 Node.js 应用程序部署到 elastic beanstalk。问题是,每次启动脚本都会失败。我已将 ec2 配置为使用启动脚本 npm start,该脚本执行 node app.js (在 package.json 中定义)。但是,此启动脚本在 ec2 中失败。我收到记录的错误,

npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the myProject start script 'node app.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the Portfolio package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node app.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs myProject
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls myProject
npm ERR! There is likely additional logging output above.

这是什么意思?在压缩到 AWS 的同一应用程序的根目录中的命令行上运行 npm start 工作正常,在本地主机上运行。我还更新了 npm 和 node.js

以下是压缩后部署的文件结构:

.zip

  • Node 模块/
  • 公开/
  • app.js
  • package.json
  • package-lock.json

最佳答案

我在 Elastic Beanstalk 上遇到了类似症状的问题,这是由于缺少 npm 依赖项引起的。一些依赖项是本地安装在node_modules中的,但一两个我们是全局安装的,导致在压缩部署时无法打包它们。不幸的是,Elastic Beanstalk 的错误消息在这种情况下没有什么帮助,并且给出了一般错误。

关于json - Elastic Beanstalk 在启动脚本时失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47489295/

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