nexe: TypeError: Cannot read property 'set' of undefined

I compiled my Node.JS script and when I ran the executable it displayed this error:

internal/modules/cjs/loader.js:1122

    throw err;
    ^

TypeError: Cannot read property 'set' of undefined
    at Object.compileFunction (vm.js:375:17)
    at wrapSafe (internal/modules/cjs/loader.js:1106:15)
    at Module._compile (internal/modules/cjs/loader.js:1140:27)
    at internal/bootstrap/pre_execution.js:118:36
    at prepareMainThreadExecution (internal/bootstrap/pre_execution.js:119:3)
    at internal/main/repl.js:18:1
  1. Downloaded nexe (via npm)
  2. nexe main.js (in the project folder)
  3. main.exe
  4. ERROR

My script only uses these dependencies:

  • http
  • fs
  • child_process

Environment:

  • Platform(OS/Version): Windows 10
  • Host Node Version: v14.1.0
  • Target Node Version: v14.1.0
  • Nexe version: 3.3.2
  • Python Version: Python 2.7.18

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 5
  • Comments: 15 (3 by maintainers)

Commits related to this issue

Most upvoted comments

force build with older version of node add this -t windows-x64-12.16.3

@LoLei downgrade to node v12.16.3 solved this issue

Same problem with

  • Windows 10
  • Node: v12.18.0
  • nexe: 3.3.2
internal/modules/cjs/loader.js:1078
  callbackMap.set(compiled.cacheKey, {
              ^

TypeError: Cannot read property 'set' of undefined
    at wrapSafe (internal/modules/cjs/loader.js:1078:15)
    at Module._compile (internal/modules/cjs/loader.js:1102:27)
    at internal/bootstrap/pre_execution.js:118:36
    at prepareMainThreadExecution (internal/bootstrap/pre_execution.js:119:3)
    at internal/main/run_main_module.js:7:1

Ahh Sorry, yeah, that option is aggressive.

Not if you need patches (as far as I know). If you just delete the resource (node binary) and use -j<CORES> in make its usually pretty quick