我使用開箱即用的expressjs應用程序,並使用節點0.8.2。在本地很好地工作,但是當我推送到Cloud Foundry時,出現以下錯誤,我不知道從何處開始調試。我假設這是由配置問題或依賴性問題引起的,但我不知道該怎麼做。Node.js應用程序,Express和Cloud Foundry
快遞 500類型錯誤:對象#沒有方法 'randomBytes' 在Object.uid(在/ var/VCAP /數據/ DEA /應用/ dwgapp1-0-690016dc6c7142f385b44b144d3d380e /應用程序/ node_modules /表達/ node_modules/(/ var/vcap/data/dea/apps/dwgapp1-0-690016dc6c7142f385b44b144d3d380e/app/node_modules/express/node_modules/connect/lib/middleware/session/lib/utils.js:122:17) at MemoryStore.generate .js:203:27) at generate(/var/vcap/data/dea/apps/dwgapp1-0-690016dc6c7142f385b44b144d3d380e/app/node_modules/express/node_modules/connect/lib/middleware/session.js:281:13) Object.session [as handle](/ var/vcap/data/dea/apps/dwgapp1-0-690016dc6c7142f385b44b144d3d380e/app/node_modules/ex (/ var/vcap/data/dea/apps/dwgapp1-0-690016dc6c7142f385b44b144d3d380e/app/node_modules/express/node_modules/connect/lib)下載/ node_modules/connect/lib/middleware/session.js:290:7) /prote.js:190:15) at Object.cookieParser [as handle](/ var/vcap/data/dea/apps/dwgapp1-0-690016dc6c7142f385b44b144d3d380e/app/node_modules/express/node_modules/connect/lib/middleware/cookieParser.js:60:5) 在下一(/var/vcap/data/dea/apps/dwgapp1-0-690016dc6c7142f385b44b144d3d380e/app/node_modules/express/node_modules/connect/lib/proto.js:190:15) 在Object.methodOverride [as handle](/var/vcap/data/dea/apps/dwgapp1-0-690016dc6c7142f385b44b144d3d380e/app/node_modules/express/node_modules/connect/lib/middleware/methodOverride.js:37:5) at下一步(/ var/vcap/data/dea/apps/dwgapp1-0-690016dc6c7142f385b44b144d3d380e/app/node_modules/express/node_modules/conn ect/lib/proto.js:190:15) at multipart(/var/vcap/data/dea/apps/dwgapp1-0-690016dc6c7142f385b44b144d3d380e/app/node_modules/express/node_modules/connect/lib/middleware/multipart.js :62:61)
var express = require('express')
, routes = require('./routes')
, user = require('./routes/user')
, http = require('http')
, path = require('path');
var app = express();
app.configure(function(){
app.set('port', process.env.VCAP_APP_PORT || 3000);
app.set('views', __dirname + '/views');
app.set('view engine', 'ejs');
app.use(express.favicon());
app.use(express.logger('dev'));
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(express.cookieParser('your secret here'));
app.use(express.session());
app.use(app.router);
app.use(require('stylus').middleware(__dirname + '/public'));
app.use(express.static(path.join(__dirname, 'public')));
});
app.configure('development', function(){
app.use(express.errorHandler());
});
app.get('/', routes.index);
app.get('/users', user.list);
http.createServer(app).listen(app.get('port'), function(){
console.log("Express server listening on port " + app.get('port'));
});
檢查是否有在版本的任何不匹配的節點和快遞中使用的雲基地 – vinayr
我已經準備好檢查... CF運行0.8.2,我運行0.8.2,我跑了vmc udate --runtime = node08 – user699242
問題,但如果我最初推使用0.8.8的應用程序是否會使用不同版本的快遞? – user699242