From ab8731c568fd6fe548fe33d1e3c8322932be76aa Mon Sep 17 00:00:00 2001 From: bcoe Date: Thu, 8 Oct 2020 17:17:01 -0700 Subject: [PATCH] fs: rimraf should not recurse on failure --- lib/internal/fs/rimraf.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/fs/rimraf.js b/lib/internal/fs/rimraf.js index e88dd9697b1938..d64feacedd0ed6 100644 --- a/lib/internal/fs/rimraf.js +++ b/lib/internal/fs/rimraf.js @@ -249,7 +249,7 @@ function _rmdirSync(path, options, originalErr) { for (let i = 1; i <= tries; i++) { try { - return rmdirSync(path, options); + return rmdirSync(path, {...options, recursive: false}); } catch (err) { // Only sleep if this is not the last try, and the delay is greater // than zero, and an error was encountered that warrants a retry.