2014-08-28 48 views
0

我想部署一個應用程序,在我的本地機器上運行openshift,並在openshift日誌中反覆獲取此錯誤。Openshift無法加載npm模塊?

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

O,我通過登錄到應用程序解決了這個問題,並從相關子目錄運行npm更新