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.
Note: I'm new to Node.js and back-end development in general so please be thorough with your answers.
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
The github repo: https://github.com/TrueAmbition001/TrueAmbition001.github.io
Thanks in advance.
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.
For some details on the S2I builder for Node.js, see:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.