diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js index 85bfc688b391c0..21544bceb463d1 100644 --- a/lib/internal/bootstrap/node.js +++ b/lib/internal/bootstrap/node.js @@ -439,7 +439,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', { @@ -448,7 +447,7 @@ value: wrappedConsole, writable: true }); - setupInspector(originalConsole, wrappedConsole, CJSModule); + setupInspector(originalConsole, wrappedConsole); } function setupGlobalURL() { @@ -521,10 +520,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 } =