lundi 30 mars 2015

How to start Node.js app in Jelastic cloud

I have tried to host my node.js app in jelastic cloud and get problem. My app works without any problem locally.I deploy it to jelastic over git repo (I push commit to private bitbucket repo, repo credentials registered in jelastic, so app should be deployed to cloud). My main app file (server.js) located in the root of repo and my pakage.json looks like this:



{
"name": "folserver",
"version": "0.0.0",
"description": "Server side for my app",
"main": "server.js",
"dependencies": {
"bcrypt-nodejs": "~0.0.3",
"urlencode": ">=0",
"json-middleware": ">=0",
"moment": ">=0",
"express": "^4.9.5",
"mongodb": "~1.3.9",
"needle": "0.7.8",
"async": ">=0",
"bunyan": ">=0"
},
"devDependencies": {
"mocha": "^2.0.1",
"should": "^4.3.0",
"supertest": "^0.15.0"
},
"scripts": {
"test": "./node_modules/.bin/mocha --require should --reporter spec -A --recursive --ui bdd testcases/tests.js",
"start": "set NODE_ENV=production&&node server.js"
},
"repository": "",
"author": "PainKiller",
"private": true
}


. But app crushes with this error (I can see it in node/node/log file):



Fri Mar 27 2015 09:54:30 GMT+0000 (UTC): Starting application 'nodejs' ... Script = server.js Script Args = Node Options =
module.js:340 throw err; ^Error: Cannot find module '/opt/repo/ROOT/server.js' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load
(module.js:280:25) at Function.Module.runMain (module.js:497:10) at startup (node.js:119:16) at node.js:906:3


As far as I can see Jelastic just can't find main file of my application. When I requested jelastic support, they said problem isn't related to their service, it's just application problem and I should ask help at specialized forums.So stackoverflow is my last hope. Thanks in advance.


Aucun commentaire:

Enregistrer un commentaire