2012-12-12 71 views
0

託管的node.js應用程序我有我的依賴類型錯誤,而在Heroku

{ 
    "name": "application-name", 
    "version": "0.0.1", 
    "private": true, 
    "scripts": { 
    "start": "node app" 
    }, 
    "dependencies": { 
    "express": ">=2.2.0", 
    "jade": "*", 
    "stylus": "*", 
    "mongodb": ">= 0.9.6-7" 
    } 

}

它在我的本地工作正常

當我主持的Node.js應用我在Heroku上的節點應用程序,我收到以下錯誤。

TypeError: Object # has no method 'randomBytes' at Object.uid (/app/node_modules/express/node_modules/connect/lib/utils.js:121:17) at MemoryStore.generate (/app/node_modules/express/node_modules/connect/lib/middleware/session.js:204:27) at generate (/app/node_modules/express/node_modules/connect/lib/middleware/session.js:288:13) at Object.session [as handle] (/app/node_modules/express/node_modules/connect/lib/middleware/session.js:297:7) at next (/app/node_modules/express/node_modules/connect/lib/proto.js:190:15) at Object.cookieParser [as handle] (/app/node_modules/express/node_modules/connect/lib/middleware/cookieParser.js:60:5) at next (/app/node_modules/express/node_modules/connect/lib/proto.js:190:15) at Object.expressInit [as handle] (/app/node_modules/express/lib/middleware.js:31:5) at next (/app/node_modules/express/node_modules/connect/lib/proto.js:190:15) at Object.query [as handle] (/app/node_modules/express/node_modules/connect/lib/middleware/query.js:44:5)

我試圖通過一個刪除行之一,並得到這個地方我刪除

app.use(express.session({ secret:'yodawgyo' })); 

的應用程序是給人以「Hello World」的響應。 請參閱下面的完整代碼。

​​

請幫我一把。

+0

快遞v2是過時的。你爲什麼不使用Express v3?請記住,從祕密的v3必須傳遞給'cookieParser'而不是'session'。 – zemirco

+0

@zeMirco:其實我正在使用的快速版本是3.0.3 ..我會嘗試使用餅乾分析器,因爲你提到 – mithunsatheesh

+0

@zeMirco:我改變了這一點,因爲你已經提到過,仍然有相同的錯誤 – mithunsatheesh

回答