command => pkg build/index.js --config package.json --targets node16-linux-x64
when i run the exe , error => spawn /snapshot/MediaServer-Ts/node_modules/mediasoup/worker/out/Release/mediasoup-worker ENOENT
thanks for the answer
It shows up as added in the logs.
[debug] The file was included as asset content
/home/hd/Desktop/MediaServer-Ts/node_modules/mediasoup/worker/out/Release/mediasoup-worker
[debug] The file was included as asset content
/home/hd/Desktop/MediaServer-Ts/node_modules/mediasoup/worker/out/Release/mediasoup-worker
[debug] The file was included as asset content
As you can see in the error log, when executing the exe it cannot find mediasoup-worker due to wrong path since pkg changes it’s location. You can tell mediasoup when the binary is (see Building.md file, there is an environmental variant for that).
yes actually the problem is import { createWorker as createWorker } from "/home/hd/Desktop/MediaServer-Ts/node_modules/mediasoup";
this is how it works
import { createWorker as createWorker } from "mediasoup";
it doesn’t work that way
this problem only happens in mediasoup library.
I asked here in case anyone faced this problem before