diff --git a/lib/internal/fs/utils.js b/lib/internal/fs/utils.js index acc566e37bb4bf..189b16b58b7d69 100644 --- a/lib/internal/fs/utils.js +++ b/lib/internal/fs/utils.js @@ -129,7 +129,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; @@ -152,7 +152,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]);