Openshift 节点应用启动失败

Openshift node app failed to start

我无法在 Openshift 上启动基于节点的应用程序。应用程序在本地启动正常,但节点的自动部署(推送到远程主存储库时)遇到日志循环问题;

DEBUG: Running node-supervisor with
DEBUG:   program './app/server.js'
DEBUG:   --watch '/var/lib/openshift/53dab282e0b8cdd367000131/app-root/data/.nodewatch'
DEBUG:   --ignore 'undefined'
DEBUG:   --extensions 'node|js|coffee'
DEBUG:   --exec 'node'
DEBUG: Starting child process with 'node ./app/server.js'
DEBUG: Watching directory '/var/lib/openshift/53dab282e0b8cdd367000131/app-root/data/.nodewatch' for changes.
module.js:340
    throw err;
          ^
Error: Cannot find module 'underscore.string'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/var/lib/openshift/53dab282e0b8cdd367000131/app-root/runtime/repo/node_modules/sequelize/lib/utils.js:5:26)
    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 Module.require (module.js:364:17)
DEBUG: Program node ./app/server.js exited with code 8
DEBUG: Starting child process with 'node ./app/server.js'
module.js:340
    throw err;
          ^
Error: Cannot find module 'underscore.string'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/var/lib/openshift/53dab282e0b8cdd367000131/app-root/runtime/repo/node_modules/sequelize/lib/utils.js:5:26)
    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 Module.require (module.js:364:17)
DEBUG: Program node ./app/server.js exited with code 8

...这个循环无限期地继续,应用程序报告 "Started" 但显然它无法初始化 sequelize.js.

此时我有点迷茫,对 Openshift 托管失去了信心。我认为这可能是最后一根稻草。有什么建议吗?

这是我的应用程序 package.json;

{
  "name": "OceanLife-API",
  "version": "1.1.0",
  "description": "OceanLife API",
  "keywords": [
    "OceanLife",
    "API",
    "tide",
    "swell",
    "weather"
  ],
  "author": {
    "name": "David Branton",
    "email": "oceanlife.development@gmail.com",
    "url": "http://oceanlifeapi-brantapps.rhcloud.com/"
  },
  "homepage": "http://oceanlifeapi-brantapps.rhcloud.com/",
  "repository": {
    "type": "git",
    "url": "https://github.com/openshift/origin-server"
  },
  "engines": {
    "node": ">= 0.10.25",
    "npm": ">= 1.3.24"
  },
  "dependencies": {
    "express": "~3.4.8",
    "sleep": "~1.1.8",
    "aglio": "~1.14.0",
    "sequelize": "~1.7.10",
    "lodash": "~2.4.1",
    "mysql": "~2.4.3",
    "cheerio": "~0.17.0",
    "moment": "~2.9.0",
    "moment-timezone": "~0.2.5",
    "tzwhere": "~1.0.0",
    "line-reader": "~0.2.4"
  },
  "scripts": {
    "lint": "./node_modules/.bin/jshint app/**/*.js",
    "pretest": "npm run-script lint",
    "test": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- --recursive -R spec"
  },
  "devDependencies": {
    "istanbul": "~0.3.5",
    "rewire": "~2.1.3",
    "sinon": "~1.12.2",
    "mocha": "~2.1.0",
    "nock": "~0.57.0",
    "dredd": "~0.3.14",
    "jshint": "~2.5.11"
  },
  "bundleDependencies": [],
  "private": true,
  "main": "./app/server.js"
}

我最近又回到了这个问题上,并设法通过使用社区构建的 Node v0.12 插件使其正常工作。如果您遇到类似问题,我建议您放弃 "official" Node v0.1 应用程序盒并重试。

太棒了 - 免费托管我的节点应用程序! :D