使用node.js进行openshift崩溃循环后退并表达

时间:2018-02-08 19:09:36

标签: javascript node.js express openshift

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

注意:我是Node.js和后端开发的新手,所以请仔细阅读答案。

Openshift错误日志:

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回购: https://github.com/TrueAmbition001/TrueAmbition001.github.io

提前致谢。

1 个答案:

答案 0 :(得分:1)

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

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