title: "mpromise (mongoose's default promise library) is deprecated" in Typescript Application
body: <p>How to resolve "mpromise (mongoose's default promise library) is deprecated" from a Typescript Application.</p>
  
  <p>I'm getting the following error:</p>
  
  <p><strong>Left-hand side of assignment expression cannot be a constant or a read-only property.</strong></p>
  
  <p>I am using a <a href="https://github.com/ericmdantas/generator-ng-fullstack" rel="nofollow noreferrer">MEAN stack with Angular 2</a> and would like to have mongoose use the bluebird promises library.</p>
  
  <p>I am getting an error when I attempt to follow these instructions on <a href="https://stackoverflow.com/questions/39333229/mpromise-mongooses-default-promise-library-is-deprecated-error-when-testing">Stack Overflow</a> and <a href="http://mongoosejs.com/docs/promises.html" rel="nofollow noreferrer">Mongo</a></p>
  
  <p>To be honest, I'm unsure if my issue is just lack of knowledge of Typescript or if I am doing something else wrong.</p>
  
  <pre><code>"use strict";
  
  import * as mongoose from 'mongoose';
  var dbConst = require('../constants/db.json');
  var bluebird = require("bluebird");
  
  export class DBConfig {
      static init():void {
        const URL = (process.env.NODE_ENV === 'production') ? process.env.MONGOHQ_URL
                                                            : dbConst.localhost;
  
        mongoose.Promise = bluebird;     // &lt;-- THIS IS WHERE ERROR OCCURS
        mongoose.connect(URL);
        mongoose.connection.on('error', console.error.bind(console, 'An error ocurred with the DB connection: '));
      }
  };
  </code></pre>