diff --git a/lib/has-native-recursive.js b/lib/has-native-recursive.js index 19c1b88..49092be 100644 --- a/lib/has-native-recursive.js +++ b/lib/has-native-recursive.js @@ -76,7 +76,17 @@ module.exports = function hasNativeRecursive(fn) { var child = stack.create('dir', parent); var file = stack.create('file', child); - stack.mkdir(parent, child); + try { + stack.mkdir(parent, child); + } catch (e) { + stack = new TempStack(); + // try again under current directory + TEMP_DIR = process.cwd(); + parent = stack.create('dir', TEMP_DIR); + child = stack.create('dir', parent); + file = stack.create('file', child); + stack.mkdir(parent, child); + } var options = { recursive: true }; var watcher;