title: fs.copy is not creating a directory, Node.js - fs.extra
body: <p>Have issues with fs.copy from the fs-extra <a href="https://www.npmjs.com/package/fs-extra" rel="nofollow noreferrer">package</a>. </p>
  
  <pre><code>fs.copy('/Library/WebServer/Documents/ewa-mypdb/backend/uploads/project/4/products/1506', '/Library/WebServer/Documents/ewa-mypdb/backend/uploads/project/4/products/test', function (err) {
    console.log(err);
    res.send(JSON.stringify(result[0]));
  })
  </code></pre>
  
  <p>The error I get is:</p>
  
  <pre><code>Error: EISDIR, read
  </code></pre>
  
  <p>This error occurs when the target expects is something else than a directory. And thats exactly what it is:</p>
  
  <p><img src="https://i.stack.imgur.com/stMzA.png" alt="enter image description here"></p>
  
  <p>Its some sort of file that is created instead of a directory. And it's the copy function that creates the file.</p>
  
  <p>Any ideas?</p>