无法将Node应用程序部署到Openshift

我试图部署一个简单的ExpressJS应用程序,我必须使用命令行工具的Openshift 。 我在下面提供了一个debugging跟踪:

>npm info ok Preparing build for deployment Deployment id is 5e2abc99 Activating deployment HAProxy already running HAProxy instance is started Starting NodeJS cartridge Sat Aug 15 2015 15:17:47 GMT-0400 (EDT): Starting application 'xxxxx' ... Waiting for application port (8080) become available ... Application 'xxxxx' failed to start (port 8080 not available) 

 Git Post-Receive Result: failure Activation status: failure Activation failed for the following gears: 55cf8fc589f5cf9dbf00023c (Error activating gear: CLIENT_ERROR: Failed to execute: 'control start' for /var/lib/openshift/55cf8fc589f5cf9dbf00023c/nodejs #<IO:0x00000001ec7290> #<IO:0x00000001ec7218> >) Deployment completed with status: failure postreceive failed 

但是我的应用程序正在侦听端口8080:

 app.listen(process.env.OPENSHIFT_NODEJS_PORT || 8080); 

谁能帮忙?

部署一个空应用程序似乎不会引发任何错误。

你有没有检查服务器上的日志? 我遇到了类似的问题,这是因为我的脚本中有语法错误。 如果你SSH进入你的应用程序和

 tail app-root/logs/nodejs.log 

你可以看到应用程序的控制台输出。 使用-n [行数]来查看更多的日志,如果10是不够的或使用较less的 ,如果你想上下滚动浏览文档,按shift + g查看文档从底部开始。

尝试通过SSHlogin到您的openshift节点。 我使用rhc工具 。 运行你的代码,你会发现问题在哪里。