【问题标题】:Deploy node.js application to elastic beanstalk (using express)将 node.js 应用程序部署到弹性 beanstalk(使用 express)
【发布时间】:2016-05-15 15:54:06
【问题描述】:

我今天整天都在将我的应用部署到弹性 beantalk 时遇到问题。我有以下项目结构(使用 react 构建的单页应用程序)

dist/
  index.html
  bundle.js
package.json
app.js

我将其压缩并上传到运行 node.js 的弹性 beanstalk

这里是 app.js

var express = require('express');
var app = express();

app.use(express.static(__dirname + '/dist'));

app.get('/*', function(req, res){
  res.sendFile(__dirname + '/dist/index.html');
});

app.listen(8080, function() {
  console.log('Listening on port: ' + 8080);
});

在本地,一切正常,但会引发警告。

【问题讨论】:

  • @davka Application update failed at 2016-02-05T16:50:37Z with exit status 1 and error: Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/50npm.sh failed. 这个命令似乎是一个问题node-pre-gyp (aws 运行它,我不知道它是什么,但运行后我得到大量错误前缀为gyp ERR!)

标签: javascript node.js amazon-web-services express


【解决方案1】:

对于遇到类似问题的任何人,事实证明它与我使用的一些依赖项有关,因此值得将它们降级,而不是使用^ version

您将能够通过 eb 生成的日志找到有关此的更多信息。

【讨论】:

    猜你喜欢
    • 2014-12-29
    • 2013-12-15
    • 2023-03-03
    • 2023-03-29
    • 2015-07-17
    • 2018-07-13
    • 2012-05-15
    • 2016-11-12
    • 1970-01-01
    相关资源
    最近更新 更多