我没有让odata-server在我的机器上工作(Windows 8.1,nodejs 0.10.30,mongo 2.4.8)。还试过干净的Ubuntu安装,同样的问题。 Repro场景:
这给出了以下输出:
Should be empty: []
Test data upload successful. 100 items inserted.
Starting NewsReader OData server.
C:\Projects\odata\node_modules\odata-server\node_modules\mongodb\lib\mongodb\connection\base.js:245
throw message;
^
TypeError: Object function createServer() {
function app(req, res, next){ app.handle(req, res, next); }
merge(app, proto);
merge(app, EventEmitter.prototype);
app.route = '/';
app.stack = [];
return app;
} has no method 'basicAuth'
at C:\Projects\odata\node_modules\odata-server\newsreader.js:14:25
at defer.<anonymous> (C:\Projects\odata\node_modules\odata-server\newsreader\context.js:123:13)
at Object.cbWrapper.success (C:\Projects\odata\node_modules\odata-server\node_modules\jaydata\lib\JayDataModules\qDeferred.js:25:38)
at NewsContext.$data.Class.define._applyTransaction (C:\Projects\odata\node_modules\odata-server\node_modules\jaydata\lib\Types\EntityContext.js:224:16)
at readyFn (C:\Projects\odata\node_modules\odata-server\node_modules\jaydata\lib\Types\EntityContext.js:1430:17)
at NewsContext.$data.Class.define._postProcessSavedItems (C:\Projects\odata\node_modules\odata-server\node_modules\jaydata\lib\Types\EntityContext.js:1473:14)
at Object.innerCallback.success (C:\Projects\odata\node_modules\odata-server\node_modules\jaydata\lib\Types\EntityContext.js:1154:29)
at Object.self._saveCollections.success (C:\Projects\odata\node_modules\odata-server\node_modules\jaydata\lib\Types\StorageProviders\mongoDB\mongoDBStorageProvider.js:653:38)
at readyFn (C:\Projects\odata\node_modules\odata-server\node_modules\jaydata\lib\Types\StorageProviders\mongoDB\mongoDBStorageProvider.js:566:22)
at esFn (C:\Projects\odata\node_modules\odata-server\node_modules\jaydata\lib\Types\StorageProviders\mongoDB\mongoDBStorageProvider.js:590:19)
我错过了什么?