got to page 15, and added , User = require('./models/User.js'); but when i try to start the app i‘m getting the following error. any ideas on what i might be doing wrong?
Code javascript:/authentication/node_modules/mongoose/lib/utils.js:413 throw err; ^ Error: Uncaught, unspecified 'error' event. at NativeConnection.EventEmitter.emit (events.js:73:15) at Model.init (/authentication/node_modules/mongoose/lib/model.js:554:31) at exports.tick (/authentication/node_modules/mongoose/lib/utils.js:408:16) at Db.ensureIndex (/authentication/node_modules/mongoose/node_modules/mongodb/lib/mongodb/db.js:1066:28) at Db.indexInformation (/authentication/node_modules/mongoose/node_modules/mongodb/lib/mongodb/db.js:1200:28) at Cursor.toArray (/authentication/node_modules/mongoose/node_modules/mongodb/lib/mongodb/cursor.js:124:30) at Cursor.each (/authentication/node_modules/mongoose/node_modules/mongodb/lib/mongodb/cursor.js:166:32) at Cursor.nextObject.self.queryRun (/authentication/node_modules/mongoose/node_modules/mongodb/lib/mongodb/cursor.js:441:39) at Cursor.close (/authentication/node_modules/mongoose/node_modules/mongodb/lib/mongodb/cursor.js:687:5) at Cursor.nextObject.commandHandler (/authentication/node_modules/mongoose/node_modules/mongodb/lib/mongodb/cursor.js:441:21)
- if i comment out in /authentication/models/User.js, the line var MyUser = db.mongoose.model('User', UserSchema); then the app starts without throwing an error.
- when i change /authentication/node_modules/mongoose/node_modules/mongodb/lib/mongodb/utils.js line 413 to console.log(err) i get : [Error: Uncaught, unspecified 'error' event.]
- when i change /authentication/node_modules/mongoose/node_modules/mongodb/lib/mongodb/utils.js line 413 to console.log(callback) i get : [function]
- when i add to /authentication/node_modules/mongoose/node_modules/mongodb/lib/mongodb/model.js 554, console.log(err); i get an error which i believe is the problem - unauthorized db:nodemarket ns:nodemarket.system.indexes lock type:0 client: xxx.xxx.xxx.xxx (my ip address)
- how do i fix that?
- why doesn’t node show this error instead of Uncaught, unspecified 'error' event?



Reply With Quote


Bookmarks