openshift - How do I figure out what dependency is missing in a Node.js project -


i trying deploy node.js project openshift , 503 when trying view site.

i aware research indicates problem webserver project. checking logs, have determined appears issue of missing dependency. however, logs don't appear tell me one:

module.js:340     throw err;           ^ error: cannot find module '/var/lib/openshift/551c63f85973ca05430002b8/app-root/runtime/repo/server.js' 

i have verified every package "required" webserver present in both package.json file , present in node_modules folder.

{   "name": "nekolist",   "version": "0.0.0",   "private": true,   "scripts": {     "start": "node ./bin/www"   },   "dependencies": {     "bcrypt-nodejs": "0.0.3",     "body-parser": "~1.12.4",     "cookie-parser": "~1.3.5",     "debug": "~2.2.0",     "ejs": "~2.3.1",     "express": "~4.12.4",     "mongoose": "^4.0.3",     "morgan": "~1.5.3",     "node-gyp": "^2.0.1",     "secure-random": "^1.1.1",     "serve-favicon": "~2.2.1"   } } 

when running npm install or npm update no errors. warnings unmet dependency on debug ~2.2.0, have same warning in project , doesn't cause critical failure. have no code uses module. it's there because part of template.

minimist@0.0.8 node_modules/node-gyp/node_modules/mkdirp/node_modules/minimist npm warn unmet dependency /var/lib/openshift/551c63f85973ca05430002b8/app-root/runtime/repo/node_modules/express/node_modules/finalhandler requires debug@'~2.2.0' load npm warn unmet dependency undefined, npm warn unmet dependency version undefined 

also, project runs fine on local development environment using webstorm built-in server.

i looking know might fix, or @ least shed light on root of issue.

thanks in advance.

[edit] so, based on saba hassan saying, looks node trying run nonexistant file server.js, instead of entry point have defined, bin/www

so, added file called server.js basic example server. openshift still cannot find file. same error message. [/edit]

[solution] have concluded basic assumption of question incorrect. endorsed answer explains why openshift looking in wrong place insertion point. however, started thread figure out why getting missing dependency error. after implementing solution below, still got same error message, missing dependency.

the explanation this:

for reason, problem insertion point file, or file requires throw error saying insertion point file module missing.

i had variable in 1 file wasn't configured right openshift , helpful error message contained in openshift logs root module missing.

conclusion "missing dependency" errors might mean have kind of logic error, somewhere in entire project. [/solution]

you using "scripts" property, on openshift should use "main" instead. because openshift uses node-supervisor start , manage node.js application. looks if don't supply "main" defaults server.js


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -