title: NodeJs forEach request-promise wait for all promises before returning
body: <p>Problem is I'm not able to get the promises to return anything. they.. just come empty.</p>
  
  <p>Every answer I see here on SO is telling me to do just this, though for some reason this is not working. I'm at my wits end, pulling hair and smashing keyboards; Can someone pin-point my dumbness?</p>
  
  <pre><code>var q = require('q');
  var request = require('request-promise'); // https://www.npmjs.com/package/request-promise
  
  function findSynonym(searchList) {
      var defer = q.defer();
      var promises = [];
      var url = "http://thesaurus.altervista.org/service.php?word=%word%&amp;language=en_US&amp;output=json&amp;key=awesomekeyisawesome";
      var wURL;
      searchList.forEach(function(word){
          wURL = url.replace('%word%',word);
          promises.push(request(wURL));
      });
  
      q.all(promises).then(function(data){
          console.log('after all-&gt;', data); // data is empty
          defer.resolve();
      });
  
      return defer;
  }
  var search = ['cookie', 'performance', 'danger'];
  
  findSynonym(search).then(function(supposedDataFromAllPromises) { // TypeError: undefined is not a function [then is not a function]
      console.log('-&gt;',supposedDataFromAllPromises); // this never happens
  });
  </code></pre>