Unable to create a Worker

Getting an error when creating a worker.
I turned on mediasoup errors as well to further debug, but I am completely lost.
I set the createWorker parameters to all the defaults as well and that did nothing.

  mediasoup:Worker constructor() +0ms
  mediasoup:Worker spawning worker process: /home/justin/Documents/Programming/mediasoup-sample-app/node_modules/mediasoup/worker/out/Release/mediasoup-worker --logLevel=error --logTag=info --logTag=ice --logTag=dtls --logTag=rtp --logTag=srtp --logTag=rtcp --rtcMinPort=10000 --rtcMaxPort=59999 +0ms
  mediasoup:Channel[pid:undefined] constructor() +0ms
  mediasoup:Worker close() +8ms
  mediasoup:Channel[pid:undefined] close() +3ms
  mediasoup:ERROR:Worker worker process failed [pid:undefined]: spawn /home/justin/Documents/Programming/mediasoup-sample-app/node_modules/mediasoup/worker/out/Release/mediasoup-worker ENOENT +0ms
{ Error: spawn /home/justin/Documents/Programming/mediasoup-sample-app/node_modules/mediasoup/worker/out/Release/mediasoup-worker ENOENT
    at _errnoException (util.js:1022:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
    at onErrorNT (internal/child_process.js:372:16)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
    at Function.Module.runMain (module.js:695:11)
    at startup (bootstrap_node.js:188:16)
    at bootstrap_node.js:609:3
  code: 'ENOENT',
  errno: 'ENOENT',
  syscall: 'spawn /home/justin/Documents/Programming/mediasoup-sample-app/node_modules/mediasoup/worker/out/Release/mediasoup-worker',
  path: '/home/justin/Documents/Programming/mediasoup-sample-app/node_modules/mediasoup/worker/out/Release/mediasoup-worker',
  spawnargs: 
   [ '--logLevel=error',
     '--logTag=info',
     '--logTag=ice',
     '--logTag=dtls',
     '--logTag=rtp',
     '--logTag=srtp',
     '--logTag=rtcp',
     '--rtcMinPort=10000',
     '--rtcMaxPort=59999' ] }

ENOENTis a well known error meaning that the binary is not found, so somehow mediasoup build process failed when you did npm install. No idea why but that’s the problem. You may miss some requirements (see the “Installation” documentation in the website).

You can also enter the /home/justin/Documents/Programming/mediasoup-sample-app/node_modules/mediasoup/worker/ folder and run make and see what happens.

2 Likes