title: Cannot read property 'pipe' of undefined in node js
body: <p>I'm trying to download image using <code>axios</code> and <code>fs</code>
  When i run it using node app.js it gives me an error saying pipe 
  can't be defined </p>
  
  <blockquote>
    <p>"TypeError: Cannot read property 'pipe' of undefined".</p>
  </blockquote>
  
  <pre><code>const axios = require('axios');
  const fs = require('fs');
  const Path = require('path');
  
  
  async function download()
  {
      const url ='https://www.google.co.in/imgres'
      const path = Path.resolve(__dirname,'files','image1.jpg')
  
      const response = axios
      (
          {
          method : 'GET',
          url:url,
  
          responseType:'stream'
          }
      )
  
      response.data.pipe(fs.createWriteStream(path))
          return new Promise((resolve,reject)=&gt;{
              response.data.on('end',()=&gt;{
              resolve()
          })
  
          response.data.on('error',err=&gt;{
              reject(err);
          })
      }).catch();
  }
  
  download().then(()=&gt;{
      console.log('download finished');
  })
  </code></pre>