ubuntu 20 fails install mediasoup-demo

this is my ubuntu environment. It meets meidasoup’s deployment environment requirements.
g++ (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
nodejs v16.19.1
Python 3.8.10
pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)
GNU Make 4.2.1

but when npm install, it occurs error like below:

I spent several days without success in solving it. I would be very appreciative if you could give some effective advice

Did you read the installation requirements? mediasoup :: Installation

I’ve read mediasoup::installation. and I’ve followed the documentation to install the relevant version of the environment, but I still get some errors.
these are my environment and version
g++ (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
nodejs v16.19.1
Python 3.8.10
pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)
GNU Make 4.2.1

OK, that seems fine. One weird thing is that you’re running everything as root. Why?

First, I’m worried about not having enough permissions when installing to cause errors. Second, I didn’t create a normal user.
Does mediasoup need to be installed under normal users?

IMO that’s weird. Mediasoup is just another npm package, why do you think it would need more permissions than any other package?

Second, I didn’t create a normal user.

That’s even weirder.

Does mediasoup need to be installed under normal users?

I always installed mediasoup under a normal user.

Ok, I will try to install mediasoup in the normal user directory.

Thank you very much for your email.

Though it’s weird, there is no technical problem with installing mediasoup as root. The problem could be with the npm cache. Or with a failed dependency download. Scroll npm dump to the end to find the actual error.

this is my error photo, i can’t get something from this.

please find attached.

Well, the problem was with downloading a patch from https://wrapdb.mesonbuild.com/v2/libuv_1.44.2-1/get_patch. Request to this address is redirected several times, the file is actually at objects.githubusercontent.com. It seems that some server in the chain has not responded properly. This happens. There were quite a few errors of this kind recently. I myself saw the libuv server (from where libuv source is downloaded, just before that patch) responding with “500 Internal Server Error”.

Ok, What can I do to fix this error?

Try again. This might have been an occasional issue.

well, i get it. i will try it again. thank you

Sorry to bother you again. I have retried more than 20 times from last night to today. But they all get the same error. I guess it’s not an accidental problem. I don’t know if I’ll have to try again more times

well, I took a closer look at the error and found that something else was prompting. Please check the attachment for the error image.
Sorry to bother you again

This time the installation went further, libuv patch was successfully downloaded, and libuv was built. But then it failed to download yet another file from github. Looks like you have some persistent network problem.

curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -

sudo apt install nodejs -y
sudo apt-get install build-essential -y
sudo apt install python3-pip -y
sudo apt update -y

The issue is likely you’re missing python3-pip or build-essentials, give that a check. Do make sure you clear the node modules of media soup if it exists still as it may fail install.