This workaround removes the tmp folder before renaming outputDir to it. We cannot eliminate the preceding mkdir because it creates all the parent folders if needed.
I'm closing this PR as similar changes landed through #46. Would be awesome to here, if the problem is fixed. Feel free to reach out in #22 if the problem still persists with the alpha.
On Windows, renaming directoryA to directoryB throws an EPERM error if directoryB exists, even if it's empty. More details in https://github.com/nodejs/node/issues/21957#issuecomment-408486653.
This workaround removes the
tmp
folder before renamingoutputDir
to it. We cannot eliminate the precedingmkdir
because it creates all the parent folders if needed.Fixes #22, #32.