title: promise-ftp unknown command with ftp.get
body: <p>I am using promise ftp to get a file and getting an error "<strong>unknown command</strong>".
  Putting debug mode on gives me the following output.</p>
  
  <pre><code>[connection] &gt; 'USER ecopo108'
  [connection] &lt; '331 User userrrrr OK. Password required\r\n'
  [parser] &lt; '331 User userrrrr  OK. Password required\r\n'
  [parser] Response: code=331, buffer='User userrrrr OK. Password required'
  [connection] &gt; 'PASS password'
  [connection] &lt; '230 OK. Current restricted directory is /\r\n'
  [parser] &lt; '230 OK. Current restricted directory is /\r\n'
  [parser] Response: code=230, buffer='OK. Current restricted directory is /'
  [connection] &gt; 'FEAT'
  [connection] &lt; '211-Extensions supported:\r\n EPRT\r\n IDLE\r\n MDTM\r\n SIZE\r\n MFMT\r\n REST STREAM\r\n MLST type*;size*;sizd*;modify*;UNIX.mode*;UNIX.uid*;UNIX.gid*;unique*;\r\n MLSD\r\n AUTH TLS\r\n PBSZ\r\n PROT\r\n UTF8\r\n TVFS\r\n ESTA\r\n PASV\r\n EPSV\r\n SPSV\r\n ESTP\r\n211 End.\r\n'
  [parser] &lt; '211-Extensions supported:\r\n EPRT\r\n IDLE\r\n MDTM\r\n SIZE\r\n MFMT\r\n REST STREAM\r\n MLST type*;size*;sizd*;modify*;UNIX.mode*;UNIX.uid*;UNIX.gid*;unique*;\r\n MLSD\r\n AUTH TLS\r\n PBSZ\r\n PROT\r\n UTF8\r\n TVFS\r\n ESTA\r\n PASV\r\n EPSV\r\n SPSV\r\n ESTP\r\n211 End.\r\n'
  [parser] Response: code=211, buffer='Extensions supported:\r\n EPRT\r\n IDLE\r\n MDTM\r\n SIZE\r\n MFMT\r\n REST STREAM\r\n MLST type*;size*;sizd*;modify*;UNIX.mode*;UNIX.uid*;UNIX.gid*;unique*;\r\n MLSD\r\n AUTH TLS\r\n PBSZ\r\n PROT\r\n UTF8\r\n TVFS\r\n ESTA\r\n PASV\r\n EPSV\r\n SPSV\r\n ESTP\r\nEnd.'
  [connection] &gt; 'OPTS UTF8 ON'
  [connection] &lt; '200 OK, UTF-8 enabled\r\n'
  [parser] &lt; '200 OK, UTF-8 enabled\r\n'
  [parser] Response: code=200, buffer='OK, UTF-8 enabled'
  [connection] &gt; 'TYPE I'
  [connection] &lt; '200 TYPE is now 8-bit binary\r\n'
  [parser] &lt; '200 TYPE is now 8-bit binary\r\n'
  [parser] Response: code=200, buffer='TYPE is now 8-bit binary'
  [connection] &gt; 'CWD ./public_html'
  [connection] &lt; '250 OK. Current directory is /public_html\r\n'
  [parser] &lt; '250 OK. Current directory is /public_html\r\n'
  [parser] Response: code=250, buffer='OK. Current directory is /public_html'
  [connection] &gt; 'EPSV'
  [connection] &lt; '500 Unknown command\r\n'
  [parser] &lt; '500 Unknown command\r\n'
  [parser] Response: code=500, buffer='Unknown command'
  { Error: Unknown command
      at makeError (C:\Users\Devon\Desktop\logfiles\node_modules\@icetee\ftp\lib\connection.js:1128:13)
      at Parser.&lt;anonymous&gt; (C:\Users\Devon\Desktop\logfiles\node_modules\@icetee\ftp\lib\connection.js:122:25)
      at emitTwo (events.js:126:13)
      at Parser.emit (events.js:214:7)
      at Parser._write (C:\Users\Devon\Desktop\logfiles\node_modules\@icetee\ftp\lib\parser.js:61:10)
      at doWrite (_stream_writable.js:396:12)
      at writeOrBuffer (_stream_writable.js:382:5)
      at Parser.Writable.write (_stream_writable.js:290:11)
      at Socket.ondata (C:\Users\Devon\Desktop\logfiles\node_modules\@icetee\ftp\lib\connection.js:298:20)
      at emitOne (events.js:116:13)
      at Socket.emit (events.js:211:7)
      at addChunk (_stream_readable.js:263:12)
      at readableAddChunk (_stream_readable.js:250:11)
      at Socket.Readable.push (_stream_readable.js:208:10)
      at TCP.onread (net.js:601:20) code: 500 }
  [connection] &lt; '500 Logout.\r\n'
  </code></pre>
  
  <p>The following is my code to get the <code>robot.txt</code> file however it doesn't get into the .then block after the ftp.get I can pull it down with an ftp client like Filezilla using the same configuration (port,host,user and pass). I get the same result without the <code>ftp.cmd</code> and have tried multiple different paths</p>
  
  <pre><code>const PromiseFtp = require("promise-ftp");
  const fs = require("fs");
  
  const config = {
    host: "host",
    user: "user",
    password: "pass",
    debug: console.log
  };
  function testFtp() {
    var ftp = new PromiseFtp();
    ftp
      .connect(config)
      .then(() =&gt; {
        return ftp.cwd("./public_html");
      })
      .then(() =&gt; {
        return ftp.get("robots.txt");
      })
      .then(function(stream) {
        return new Promise(function(resolve, reject) {
          stream.once("close", resolve);
          stream.once("error", reject);
          stream.pipe(fs.createWriteStream("robots.txt"));
        });
      })
      .then(function() {
        return ftp.end();
      })
      .catch(err =&gt; {
        console.log(err);
        ftp.end();
      });
  }
  
  testFtp();
  </code></pre>
  
  <p>using node.js &amp; promise-ftp 1.3.5</p>