简体   繁体   中英

Node js application on Openshift error

This is the link to my github repo

I am trying to make an application in node js, a simple cron that sends email every second. I want to host it on Openshift server. But I dont know/can't understand how to make it work. Did a lot of research but still just cant make it work.

I would like you'll to review my code, specially package.json and server.js The error that i get is when I echo the log

You specified a Timezone but have not included the `time` module. Timezone funct
ionality is disabled. Please install the `time` module to use Timezones in your
application.
events.js:72
         throw er; // Unhandled 'error' event
          ^
Error: listen EACCES
at errnoException (net.js:884:11)
at Server._listen2 (net.js:1003:19)
at listen (net.js:1044:10)
at Server.listen (net.js:1110:5)
at Object.<anonymous> (/var/lib/openshift/53671fef4382ec57c1000097/app-root/
runtime/repo/server.js:3:7)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
DEBUG: Program node server.js exited with code 8
DEBUG: Starting child process with 'node server.js'

I am just a beginner to node.js, any help will be greatly appreciated.

EDIT : This scripts works perfectly fine on LOCALHOST. Even without having to install the "time" module.

This error shows that the module 'time' is missing.

try:

npm install -g time

EDIT

I was trying to run your code in my local, and I get this same error. When i type npm install -g time, I get error:

Error: Can't find Python executable "python", you can set the PYTHON env variable.

So, maybe You should install python.exe first, on your production machine? In windows You have to set the environment variable, eg:

set PYTHON=D:\Python\bin\Python.exe

I have no more ideas

In your package.json, add "time" module to the dependencies object:

"dependencies": {
    // other modules...
    //  :
    //  :

    "time": "*"
},

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM