diff --git a/lib/fs.js b/lib/fs.js index d390335df8c72c..50d6afc8b41e08 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -1550,7 +1550,7 @@ fs.realpathSync = function realpathSync(p, cache) { } } if (linkTarget === null) { - fs.accessSync(base, fs.F_OK); // Throws ELOOP on cyclic links. + fs.statSync(base); linkTarget = fs.readlinkSync(base); } resolvedLink = pathModule.resolve(previous, linkTarget);