Worker process failed [pid:undefined]

Hi guys,

I was able to run this in one of my Mac successfully but failing in another, below is the error I receive when trying npm start after npm install. I have generated HTTPS localhost certificate and key and changed the config.js to reflect but as I can tell the problem is not there since there no chance to start the HTTPS server anyway.

mediasoup:ERROR:Worker worker process failed [pid:undefined]: spawn /Users/user/Docs/Projects/server/server/node_modules/mediasoup/worker/out/Release/mediasoup-worker ENOENT +0ms
(node:1045) UnhandledPromiseRejectionWarning: Error: spawn /Users/user/Docs/Projects/server/server/node_modules/mediasoup/worker/out/Release/mediasoup-worker ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:268:19)
at onErrorNT (internal/child_process.js:468:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
(Use node --trace-warnings ... to show where the warning was created)
(node:1045) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see (rejection id: 1)
(node:1045) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Mac details.

MacBook Pro (13-inch, 2020, Four Thunderbolt 3 ports)
processor: 2 GHz Quad-Core Intel Core i5
memory: 16 GB 3733 MHz LPDDR4
graphics: Intel Iris Plus Graphics 1536 MB

NPM version: 6.14.5
Node version: v14.3.0

I appreciate your input :slight_smile:

Did npm install terminate successfully on that second Mac?

1 Like

So mediasoup was not compiled in the failing machine so npm install did not success.

  • Enter mediasoup-demo/server/node_mocules/mediasoup and run npm install and paste the output.
  • BTW: do you have XCode installed in the failing machine and it runs Catalina? If so, ensure you run npm install again in mediasoup-demo/server since the latest mediasoup version is ready to compile in Catalina without XCode. Previous versions were not.

I thought it is related to XCode, in the beginning, I didn’t, then installed because the first error I received it was related to that, installed XCode, restarted mac, and run npm install but I assume yes, still something is missing.

audited 915 packages in 2.38s
13 packages are looking for funding
run npm fund for details
found 8 low severity vulnerabilities
run npm audit fix to fix them, or npm audit for details

It looks like it is finished successfully but with some audit issues.

EDIT: Both mac versions: 10.15.5 macOS Catalina

Audit issues are related to other deps of deps of deps in the mediasoup-demo project. Irrelevant here.

  • Please clone the mediasoup-demo again in a fresh folder, enter server/ directory and run npm install and paste the output.
  • After that, enter server/node_modules/mediasoup/worker, run make and paste the output.
  • In addition, confirm whether you have /usr/sbin/softwareupdate command or not in your system.

npm install output:


confirmed command exist: /usr/sbin/softwareupdate

It just worked fine. What’s the problem now? There shouldn’t be any problem if you run the demo server now in that new installation.

I was just about to respond :slight_smile:

This time it worked fine! Thank you guys :slight_smile:

mediasoup-demo-server:INFO creating Express app… +249ms
mediasoup-demo-server:INFO running an HTTPS server… +3ms
mediasoup-demo-server:INFO running protoo WebSocketServer… +11ms

Probably you installed now the latest mediasoup v3 branch which can compile without XCode. Such a commit was just pushed today.

That makes sense since we were trying yesterday before installing Xcode and npm installed failed. Nicely done, time to learn the APIs and start sending video/audio!

I am getting same error after deploy by using docker.

Did you read the mediasoup installation requirements?

Sorry, this issue was related with Docker setting.