使用node.js和express进行openshift崩溃循环回退 [英] openshift crash loop back-off with node.js and express

查看:96
本文介绍了使用node.js和express进行openshift崩溃循环回退的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我一直在尝试使用Openshift为动态网页创建一个服务器,所以我创建了一个简单的node.js / Express模板,仅用于连接到Index.html(以测试代码)但是当我尝试并运行代码Openshift进入崩溃循环后退。

So I've been trying to create a server for dynamic web pages using Openshift, so I created a bare-bones node.js/Express template just for connecting to Index.html (to test the code) but when I try and run the code Openshift goes into a crash loop back-off.

注意:我是Node.js和后端开发的新手,所以请彻底你的答案。

Note: I'm new to Node.js and back-end development in general so please be thorough with your answers.

Openshift错误日志:

The Openshift error log:

Environment: 
    DEV_MODE=false
    NODE_ENV=production
    DEBUG_PORT=5858
Launching via npm...
npm info it worked if it ends with ok
npm info using npm@3.10.9
npm info using node@v6.11.3
npm ERR! Linux 3.10.0-693.15.2.el7.x86_64
npm ERR! argv "/opt/rh/rh-nodejs6/root/usr/bin/node" "/opt/rh/rh-nodejs6/root/usr/bin/npm" "run" "-d" "start"
npm ERR! node v6.11.3
npm ERR! npm  v3.10.9
npm ERR! path /opt/app-root/src/package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open

npm ERR! enoent ENOENT: no such file or directory, open '/opt/app-root/src/package.json'
npm ERR! enoent ENOENT: no such file or directory, open '/opt/app-root/src/package.json'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! Please include the following file with any support request:
npm ERR!     /opt/app-root/src/npm-debug.log

github repo:
https://github.com/TrueAmbition001/TrueAmbition001.github.io

The github repo: https://github.com/TrueAmbition001/TrueAmbition001.github.io

提前致谢。

推荐答案

Node.js S2I构建器需要 package.json 和应用程序代码位于repo的根目录中,您将它放在子目录中。因此,代码的结构与所需的结构不匹配。

The Node.js S2I builder requires the package.json and application code to be in the root directory of the repo, you have it in a sub directory. So the structure of your code doesn't match what is required.

有关Node.js的S2I构建器的一些详细信息,请参阅:

For some details on the S2I builder for Node.js, see:

  • https://github.com/sclorg/s2i-nodejs-container/tree/master/8

这篇关于使用node.js和express进行openshift崩溃循环回退的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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