Openshift无法加载npm模块?

时间:2014-08-28 12:47:51

标签: node.js openshift

我正在尝试将在本地计算机上运行的应用程序部署到openshift,并在openshift日志中重复出现此错误。

DEBUG: Program node app.js exited with code 8
DEBUG: Starting child process with 'node app.js'
Thu, 28 Aug 2014 12:41:39 GMT express-session deprecated undefined resave option; provide resave option at app.js:34:11
Thu, 28 Aug 2014 12:41:39 GMT express-session deprecated undefined saveUninitialized option; provide saveUninitialized option at app.js:34:11
js-bson: Failed to load c++ bson extension, using pure JS version
module.js:340
    throw err;
          ^
Error: Cannot find module './lib'
    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/53ff14425973ca8c8600046a/app-root/runtime/repo/node_modules/request/node_modules/qs/index.js:1:80)
    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.js exited with code 8
DEBUG: Starting child process with 'node app.js'

我正在使用的package.json文件是

{
  "name": "restodb",
  "version": "0.1.0",
  "description": "Backend for AF resto database",
  "main": "app.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "async": "^0.9.0",
    [snip],
    "path": "^0.4.9",
    "request": "^2.40.0"
  },
  "devDependencies": {
    "grunt-shell-spawn": "^0.3.0"
  }
}

我登录了应用程序,可以看到虽然请求qs中有node_modules目录,但它没有./lib目录,这很奇怪。感谢您尝试的建议。

1 个答案:

答案 0 :(得分:1)

O,我通过登录应用程序并从相关子目录

运行npm update来解决这个问题
相关问题