diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js index 0ac0559000732b..885546c5d6f1ca 100644 --- a/lib/internal/bootstrap/node.js +++ b/lib/internal/bootstrap/node.js @@ -403,7 +403,6 @@ function setupGlobalConsole() { const originalConsole = global.console; - const CJSModule = NativeModule.require('internal/modules/cjs/loader'); // Setup Node.js global.console. const wrappedConsole = NativeModule.require('console'); Object.defineProperty(global, 'console', { @@ -412,7 +411,7 @@ value: wrappedConsole, writable: true }); - setupInspector(originalConsole, wrappedConsole, CJSModule); + setupInspector(originalConsole, wrappedConsole); } function setupGlobalURL() { @@ -438,10 +437,11 @@ NativeModule.require('internal/domexception'); } - function setupInspector(originalConsole, wrappedConsole, CJSModule) { + function setupInspector(originalConsole, wrappedConsole) { if (!process.config.variables.v8_enable_inspector) { return; } + const CJSModule = NativeModule.require('internal/modules/cjs/loader'); const { addCommandLineAPI, consoleCall } = process.binding('inspector'); // Setup inspector command line API. const { makeRequireFunction } =