Sometimes, when deleting a directory that has sub-directories and files it throw an error witch code: ENOTEMPTY.
When executing this: rm('-rf', '/path/to/build/zip') the following error is thrown:
rm: could not remove directory (code ENOTEMPTY): build/zip/vendors/bootstrap
Note: It can happen with any sub-directory, is not related to a particular directory only. It doesn't happens with files.