diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js index 324fdb71a62..d95f1aa2939 100644 --- a/lib/internal/bootstrap/node.js +++ b/lib/internal/bootstrap/node.js @@ -30,13 +30,6 @@ const isMainThread = internalBinding('worker').threadId === 0; function startup() { - const EventEmitter = NativeModule.require('events'); - - const origProcProto = Object.getPrototypeOf(process); - Object.setPrototypeOf(origProcProto, EventEmitter.prototype); - - EventEmitter.call(process); - setupTraceCategoryState(); setupProcessObject(); @@ -378,6 +371,11 @@ } function setupProcessObject() { + const EventEmitter = NativeModule.require('events'); + const origProcProto = Object.getPrototypeOf(process); + Object.setPrototypeOf(origProcProto, EventEmitter.prototype); + EventEmitter.call(process); + _setupProcessObject(pushValueToArray); function pushValueToArray() {