title: TypeError: promise.then(...).then(...).then(...).then(...).catch is not a function in Node Js
body: <p>Im getting this error and i dont know how to solve it.
  In a node js server, i'm using some .then() function on a promise and at the end i placed a .catch() function that for some reason is not recognized.
  I have seen in many places in tutorials that this is how an error is handled. 
  I'm not using any external libraries.</p>
  
  <p>The error :</p>
  
  <pre><code> TypeError: promise.then(...).then(...).then(...).then(...).catch is not a function
  </code></pre>
  
  <p>This is my code:</p>
  
  <pre><code>exports.joinAlbum = function(req, res){
  
  
  var promise = Album.findOne().where({'shortId': req.body.shortId}).exec(); // Returns a promise
  
  
  promise.then(function(albumDoc){
      console.log('Then #1');
  
      .....
  
      }
      return albumDoc.save();  // Returns a promise
  })
  
  
  
  .then(function(albumDoc){
      console.log('Then #2');
  
      .....
  
      return User.findById(req.body.userId).exec(); // Returns a promise
  })
  
  
  .then(function(userDoc){
      console.log('Then #3');
  
       ........
  
      return userDoc.save();  // Returns a promise
  })
  
  //  Return a response
  .then(function(savedUserDoc){
      console.log('Then #4');
      return res.status(200).json({success: true}); 
  })
  
      //Error handler
  .catch(function(err){
      console.log('Catch #1');
      console.log(err);
      res.status(200).json({success: false});
  });
  }
  </code></pre>
  
  <p>If .catch() is not the correct way to handle promise error, what do you suggest? Im trying to avoid using external libraries and prefer using native javascript</p>
  
  <p><strong>EDIT: solution</strong></p>
  
  <p>I added a npm module called blue-bird that helped me solve this.</p>