Express Hello World - Heroku Foreman返回代码5,'npm start'工作得很好 [英] Express Hello World -- Heroku Foreman Returns Code 5, 'npm start' works just fine

查看:172
本文介绍了Express Hello World - Heroku Foreman返回代码5,'npm start'工作得很好的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Express创建一个简单的Hello World的教程。本教程使用'npm start'在本地启动并运行。然后,教程继续准备通过Toolbelt将代码上传到Heroku。遵循指示(据我所知),我执行'领班开始'。当我点击localhost URI时,我得到了我期待的基本HTML,但没有CSS(无疑与我在控制台窗口中看到的ERR_CONNECTION_REFUSED输出有关,这可能与整个服务器关闭有关)。查看命令行的输出结果:

 用代码5退出
向所有用户发送SIGKILL处理

我搜索了Google Foreman的代码5,但没有看到任何讨论过的地方代码5.我在 https://github.com/ddollar/foreman 上下载了Foreman的源代码,但仍然无法弄清楚代码5是什么(!?!?)。如果我知道代码5是什么意思,我怀疑我可以解决这个问题。任何人都知道它是什么?

解决方案

我确切地遇到了您的问题,包括确切的那些工头消息和ERR_CONNECTION_REFUSED消息服务器停止。

在过去,我已经回到工头0.61.0作为解决方法(在Windows 7上),但0.61.0与Express 4不兼容,这对我来说已经不再可行了。



我从来没有找到针对code 5错误的解决方案,但现在有更好的方法可以使用:


  • 下载并安装最新版本的heroku toolbelt。

  • 更长的支持),请使用新命令 heroku local 启动您的应用程序。 $ b $ p
    $ b

    这适用于Windows 7。我在SO


    I'm following a tutorial in which I created a simple "Hello World" in Express. The tutorial gets everything up and running locally just fine with 'npm start'. The tutorial then moves on to prepare for uploading code to Heroku via Toolbelt. Following the directions (so far as I can tell), I execute 'foreman start'. When I hit the localhost URI, I get the basic HTML I'm expecting, but no CSS (no doubt related to the ERR_CONNECTION_REFUSED outputs I see in the console window, which is probably related to the whole server being shut down). Looking at the output from the command line, there is the text:

    exited with code 5
    sending SIGKILL to all processes
    

    I've searched Google for what Foreman's code 5 is, but didn't see anywhere that discussed code 5. I downloaded the source code for Foreman on https://github.com/ddollar/foreman, but still couldn't figure out what code 5 is (!?!?). I suspect I could work out the issue if I knew what code 5 meant. Anyone out there know what it is?

    解决方案

    I faced exactly your problem, including exactly those foreman messages, and the ERR_CONNECTION_REFUSED messages after the server stopped.

    In the past I had regressed to version 0.61.0 of foreman as a workaround (on Windows 7), but 0.61.0 is incompatible with Express 4, so that was no longer viable for me.

    I never found a solution for the "code 5" error, but happily a better approach is now available:

    • Download and install the latest version of heroku toolbelt.

    • Instead of instead of using foreman (which heroku no longer supports), start your application using the new command "heroku local".

    This worked for me on Windows 7. I posted more details on SO here.

    这篇关于Express Hello World - Heroku Foreman返回代码5,'npm start'工作得很好的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆