diff --git a/lib/internal/modules/cjs/helpers.js b/lib/internal/modules/cjs/helpers.js index fb25ffdae921ad..ed9727fd536392 100644 --- a/lib/internal/modules/cjs/helpers.js +++ b/lib/internal/modules/cjs/helpers.js @@ -36,7 +36,7 @@ function loadNativeModule(filename, request, skipCompile = false) { const mod = NativeModule.map.get(filename); if (mod) { debug('load native module %s', request); - if (skipCompile) { + if (!skipCompile) { // compileForPublicLoader() throws if mod.canBeRequiredByUsers is false: mod.compileForPublicLoader(); }