node.jsexpressrouterfs-extra

Using fs.extra copyRecursive gives a "TypeError: forEachAsync is not a function" error and I can't fix it


My code is : http://pastebin.com/rCy4wSUK

As soon as this function is called by router it prints "done copying contents of clean base into temp" and then error which is here: http://pastebin.com/UxEu4PaS

So at least it is not giving an error in copying but what is causing it to throw this error.


Solution

  • Sounds like the fs.extra module has not installed completely and is missing a dependency. Your code runs fine for me with a fresh npm install fs.extra q

    Remove your node_modules folder and re-run npm install (if your dependencies are listed in package.json) or npm install fs.extra q (if they are not).