diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js index 0727c8d2cffad3..ec44e821876a81 100644 --- a/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js @@ -1027,7 +1027,8 @@ Module._resolveFilename = function(request, parent, isMain, options) { const isRelative = StringPrototypeStartsWith(request, './') || StringPrototypeStartsWith(request, '../') || ((isWindows && StringPrototypeStartsWith(request, '.\\')) || - StringPrototypeStartsWith(request, '..\\')); + StringPrototypeStartsWith(request, '..\\')) || + request === '..' || request === '.'; if (isRelative) { paths = options.paths;