node.js アプリを jelastic クラウドでホストしようとしましたが、問題が発生しました。私のアプリはローカルで問題なく動作します。git リポジトリを介して jelastic にデプロイします (コミットをプライベート bitbucket リポジトリにプッシュし、リポジトリ資格情報を jelastic に登録するため、アプリをクラウドにデプロイする必要があります)。レポのルートにあるメインのアプリ ファイル (server.js) と pakage.json は次のようになります。
{
"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
}
. しかし、アプリはこのエラーでクラッシュします (node/node/log ファイルで確認できます):
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
私が見る限り、Jelastic はアプリケーションのメイン ファイルを見つけることができません。jelastic のサポートに問い合わせたところ、問題はサービスに関係なく、単なるアプリケーションの問題であり、専門のフォーラムで質問する必要があるとのことでした。スタックオーバーフローが私の最後の希望です。前もって感謝します。