Type Error in Promisifying Mongoose Connect Type Error in Promisifying Mongoose Connect mongoose mongoose

Type Error in Promisifying Mongoose Connect


I am working on the same tutorial.
Bluebird changes the api in 3.0 from// 2.x Promise.promisify(fn, ctx);// 3.0 Promise.promisify(fn, {context: ctx});

I made the call change and the calls stopped throwing the errors.

See here for the Bluebird explanation:http://bluebirdjs.com/docs/new-in-bluebird-3.html

Hope this helps


The following code seems to works for me.

var connectMongoose = Promise.promisify(mongoose.connect, {context: mongoose}); connectMongoose('MONGO_URL', mongoose) .then(..)


I'm working on the same tutorial as well, and here is what I did to resolve the issue.

npm uninstall bluebirdnpm install --save bluebird@2.0

Then when you run your tests with mocha you should pass.