Why node.js async module stops after the first step using async.eachLimit(array, limit, function, callback)?

If I use this code:

async.eachLimit(body.photos.photo, 10, function(photo) {

         var flickr_getphoto_path = ".....";

         request.get({url: flickr_host_url + flickr_getphoto_path, json: true}, function(error, response, body) {
           if (!error && response.statusCode == 200) {

             console.log("SIZES LENGTH: " + body.sizes.size.length);
             var source_url = body.sizes.size[body.sizes.size.length - 1].source;
             request(source_url).pipe(fs.createWriteStream(path_for_downloads + path.basename(source_url)));
           }
         });

}

The processing stops after 10 requests (i.e. after the first cycle). There should be 10 cycles.

Does somebody know why it doesn't work properly?

You set up the async function wrong. The third argument (the iterator function) takes two parameters: the item being iterated upon, and a callback to tell async that it's done. You're missing (and thus never calling) the callback, so async doesn't know that it's time to do the next batch.

var async = require('async');

async.eachLimit(body.photos.photo, 10, cacheOnePhoto, function(err){
  if(err){
    console.log(err);
  } else {
    console.log('Processing complete');
  };
})

function cacheOnePhoto(photo, done){
  var flickr_getphoto_path = ".....";
  request.get({
    url: flickr_host_url + flickr_getphoto_path, 
    json: true
  }, function(error, response, body) {
    if (!error && response.statusCode == 200) {
      console.log("SIZES LENGTH: " + body.sizes.size.length);
      var source_url = body.sizes.size[body.sizes.size.length - 1].source;
      request(source_url).pipe(
        fs.createWriteStream(path_for_downloads + path.basename(source_url))
      );
      done(null);
    } else {
      done('Request error for '+flickr_getphoto_path);
    }
  });
};