Closed hashtafak closed 5 years ago
What's the error you get?
$ node --experimental-worker testm
1000000
I'm using quick example code: https://github.com/wilk/microjob#quick-example
Then complie with nexe
$ nexe testm.js --enableNodeCli --build --verbose
i nexe 2.0.0-rc.34
√ Downloading Node.js source from: https://nodejs.org/dist/v10.15.0/node-v10.15.0.tar.gz
√ Source already downloaded
√ Compiling result
√ Writing result to file
√ Entry: 'testm.js' written to: testm.exe
√ Finished in 1.123s
Run complied file
$ testm --experimental-worker
TypeError [ERR_WORKER_PATH]: The worker script filename must be an absolute path or a relative path starting with './' or '../'. Received "dist/worker.js"
at new Worker (internal/worker.js:264:15)
at Promise (..\testm.exe:212:32)
at new Promise (<anonymous>)
at WorkerPool.setup (..\testm.exe:208:16)
at ..\testm.exe:19:13
at Object.<anonymous> (..\testm.exe:38:5)
at c (..\testm.exe:272:3584)
at Function.r.import (..\testm.exe:272:4190)
at ..\testm.exe:269:15
at Object.<anonymous> (..\testm.exe:272:1)
Solved in https://github.com/wilk/microjob/releases/tag/v0.4.2 🎉 Thanks ;)
I see in the code you use
const worker = new worker_threads_1.Worker(
${dirname}/worker.js);
That should be fix to `.Worker(path.resolve(dirname, './worker.js'));`I'm trying to compile .js into 1 .exe file using nexe then can't run with your current code.