Openshift节点应用程序无法启动

时间:2015-01-18 23:58:44

标签: node.js deployment openshift sequelize.js

我无法在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

...此循环无限期地继续,应用报告&#34;已开始&#34;但显然它未能初始化 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"
}

1 个答案:

答案 0 :(得分:0)

我最近回到这里,并设法通过使用社区构建的Node v0.12盒式磁带来实现它。如果您遇到类似问题,我建议放弃“官方”Node v0.1应用程序盒并重试。

甜蜜 - 免费托管我的节点应用程序! :d