diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js index ed5a5afe4b8072..e9571a89a62857 100644 --- a/lib/internal/bootstrap/pre_execution.js +++ b/lib/internal/bootstrap/pre_execution.js @@ -385,7 +385,7 @@ function initializeFrozenIntrinsics() { function loadPreloadModules() { // For user code, we preload modules if `-r` is passed const preloadModules = getOptionValue('--require'); - if (preloadModules) { + if (preloadModules && preloadModules.length > 0) { const { Module: { _preloadModules