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}/`)}`);
});
您应该将该问题标记为已解决:)