Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Heroku错误部署_Heroku_Deployment_Webpack_Bundle - Fatal编程技术网

Heroku错误部署

Heroku错误部署,heroku,deployment,webpack,bundle,Heroku,Deployment,Webpack,Bundle,我正在尝试部署,但此错误无法释放我 2017-07-21T02:57:41.976265+00:00 app[web.1]: webpack: Compiled successfully. 2017-07-21T02:57:43.657908+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch 2017-07-21T0

我正在尝试部署,但此错误无法释放我

2017-07-21T02:57:41.976265+00:00 app[web.1]: webpack: Compiled successfully.
2017-07-21T02:57:43.657908+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2017-07-21T02:57:43.658077+00:00 heroku[web.1]: Stopping process with SIGKILL
2017-07-21T02:57:43.988993+00:00 heroku[web.1]: Process exited with status 137
2017-07-21T02:57:44.004007+00:00 heroku[web.1]: State changed from starting to crashed
这是我的服务器配置

const PORT = process.env.PORT || 5000;
app.listen(PORT, 'localhost', err => {
  err && console.error(err);
  console.log(`Listening at 
  ${chalk.bold.cyan(`http://localhost:${PORT}/`)}`);
});

您不应该指定
localhost
,否则节点将只侦听本地接口,Heroku进程管理器将无法看到您的进程实际正在运行

app.listen(PORT, err => {
  err && console.error(err);
  console.log(`Listening at 
  ${chalk.bold.cyan(`http://localhost:${PORT}/`)}`);
});

您应该将该问题标记为已解决:)