diff --git a/lib/internal/fs/utils.js b/lib/internal/fs/utils.js index 889cafa3842c8c..5a5ac3bfa263b0 100644 --- a/lib/internal/fs/utils.js +++ b/lib/internal/fs/utils.js @@ -131,7 +131,7 @@ function getDirents(path, [names, types], callback) { const name = names[i]; const idx = i; toFinish++; - lazyLoadFs().stat(pathModule.resolve(path, name), (err, stats) => { + lazyLoadFs().lstat(pathModule.join(path, name), (err, stats) => { if (err) { callback(err); return; @@ -154,7 +154,7 @@ function getDirents(path, [names, types], callback) { const type = types[i]; if (type === UV_DIRENT_UNKNOWN) { const name = names[i]; - const stats = lazyLoadFs().statSync(pathModule.resolve(path, name)); + const stats = lazyLoadFs().lstatSync(pathModule.join(path, name)); names[i] = new DirentFromStats(name, stats); } else { names[i] = new Dirent(names[i], types[i]);