Request reported a mistake, what’s the matter, the official method is wrong!

  node.js, question

According to this example in,
You can stream any response to a file stream.


Original document

var fs = require('fs');
 var path = require('path');
 var request = require('request');
 var cheerio = require('cheerio');

The execution of the horse is reported as follows:

 throw er;  // Unhandled stream error in pipe.
 Error: read ECONNRESET
 at exports._errnoException (util.js:870:11)
 at TCP.onread (net.js:552:26)

node v4.4.5

The reason is simple: Google is blocked by the great The Wall

I casually changed to a picture address from Baidu and succeeded

var url = ',2801480363&fm=5';
// request('').pipe(fs.createWriteStream('doodle.png'));