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 Command-line API | Node.js v21.2.0 Documentation). (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
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.
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!