Installation fails in ubuntu 20.04

Hello,

I am trying to install mediasoup-demo in ubuntu 20.04, node lts/gallium, python 3.8 and the installation fails with this log about a meson bug. Any idea about it will be appreciated. If you prefer screenshots for logs, please indicate to me.Thanks

npm ERR! ERROR: Unhandled python exception
npm ERR! 
npm ERR!     This is a Meson bug and should be reported!
npm ERR! make: Leaving directory '/home/geeksha/mediasoup-demo/server/node_modules/mediasoup/worker'
npm ERR! ERROR: launchpadlib 1.10.13 requires testresources, which is not installed.
npm ERR! Directory does not contain a valid build tree:
npm ERR! /home/geeksha/mediasoup-demo/server/node_modules/mediasoup/worker/out/Release/build
npm ERR! Traceback (most recent call last):
npm ERR!   File "/home/geeksha/mediasoup-demo/server/node_modules/mediasoup/worker/out/pip/mesonbuild/msetup.py", line 229, in _generate
npm ERR!   File "/home/geeksha/mediasoup-demo/server/node_modules/mediasoup/worker/out/pip/mesonbuild/interpreter/interpreter.py", line 2554, in run
npm ERR!     super().run()
npm ERR!   File "/home/geeksha/mediasoup-demo/server/node_modules/mediasoup/worker/out/pip/mesonbuild/interpreterbase/interpreterbase.py", line 148, in run
npm ERR!     self.evaluate_codeblock(self.ast, start=1)
npm ERR!   File "/home/geeksha/mediasoup-demo/server/node_modules/mediasoup/worker/out/pip/mesonbuild/interpreterbase/interpreterbase.py", line 173, in evaluate_codeblock
npm ERR!     raise e
npm ERR!   File "/home/geeksha/mediasoup-demo/server/node_modules/mediasoup/worker/out/pip/mesonbuild/interpreterbase/interpreterbase.py", line 166, in evaluate_codeblock
npm ERR!     self.evaluate_statement(cur)
npm ERR!   File "/home/geeksha/mediasoup-demo/server/node_modules/mediasoup/worker/out/pip/mesonbuild/interpreterbase/interpreterbase.py", line 181, in evaluate_statement
npm ERR!     self.assignment(cur)
npm ERR!   File "/home/geeksha/mediasoup-demo/server/node_modules/mediasoup/worker/out/pip/mesonbuild/interpreterbase/interpreterbase.py", line 566, in assignment
npm ERR!     value = self.evaluate_statement(node.value)
npm ERR!   File "/home/geeksha/mediasoup-demo/server/node_modules/mediasoup/worker/out/pip/mesonbuild/interpreterbase/interpreterbase.py", line 179, in evaluate_statement
npm ERR!     return self.function_call(cur)
npm ERR!   File "/home/geeksha/mediasoup-demo/server/node_modules/mediasoup/worker/out/pip/mesonbuild/interpreterbase/interpreterbase.py", line 454, in function_call
npm ERR!     res = func(node, func_args, kwargs)
npm ERR!   File "/home/geeksha/mediasoup-demo/server/node_modules/mediasoup/worker/out/pip/mesonbuild/interpreterbase/decorators.py", line 768, in wrapped
npm ERR!     return f(*wrapped_args, **wrapped_kwargs)
npm ERR!   File "/home/geeksha/mediasoup-demo/server/node_modules/mediasoup/worker/out/pip/mesonbuild/interpreterbase/decorators.py", line 115, in wrapped
npm ERR!     return f(*wrapped_args, **wrapped_kwargs)
npm ERR!   File "/home/geeksha/mediasoup-demo/server/node_modules/mediasoup/worker/out/pip/mesonbuild/interpreterbase/decorators.py", line 276, in wrapper
npm ERR!     return f(*nargs, **wrapped_kwargs)
npm ERR!   File "/home/geeksha/mediasoup-demo/server/node_modules/mediasoup/worker/out/pip/mesonbuild/interpreter/interpreter.py", line 800, in func_subproject
npm ERR!     return self.do_subproject(args[0], 'meson', kwargs)
npm ERR!   File "/home/geeksha/mediasoup-demo/server/node_modules/mediasoup/worker/out/pip/mesonbuild/interpreter/interpreter.py", line 877, in do_subproject
npm ERR!     raise e
npm ERR!   File "/home/geeksha/mediasoup-demo/server/node_modules/mediasoup/worker/out/pip/mesonbuild/interpreter/interpreter.py", line 861, in do_subproject
npm ERR!     return self._do_subproject_meson(subp_name, subdir, default_options, kwargs)
npm ERR!   File "/home/geeksha/mediasoup-demo/server/node_modules/mediasoup/worker/out/pip/mesonbuild/interpreter/interpreter.py", line 900, in _do_subproject_meson
npm ERR!     subi.run()
npm ERR!   File "/home/geeksha/mediasoup-demo/server/node_modules/mediasoup/worker/out/pip/mesonbuild/interpreter/interpreter.py", line 2554, in run
npm ERR!     super().run()
npm ERR!   File "/home/geeksha/mediasoup-demo/server/node_modules/mediasoup/worker/out/pip/mesonbuild/interpreterbase/interpreterbase.py", line 148, in run
npm ERR!     self.evaluate_codeblock(self.ast, start=1)
npm ERR!   File "/home/geeksha/mediasoup-demo/server/node_modules/mediasoup/worker/out/pip/mesonbuild/interpreterbase/interpreterbase.py", line 173, in evaluate_codeblock
npm ERR!     raise e
npm ERR!   File "/home/geeksha/mediasoup-demo/server/node_modules/mediasoup/worker/out/pip/mesonbuild/interpreterbase/interpreterbase.py", line 166, in evaluate_codeblock
npm ERR!     self.evaluate_statement(cur)
npm ERR!   File "/home/geeksha/mediasoup-demo/server/node_modules/mediasoup/worker/out/pip/mesonbuild/interpreterbase/interpreterbase.py", line 181, in evaluate_statement
npm ERR!     self.assignment(cur)
npm ERR!   File "/home/geeksha/mediasoup-demo/server/node_modules/mediasoup/worker/out/pip/mesonbuild/interpreterbase/interpreterbase.py", line 566, in assignment
npm ERR!     value = self.evaluate_statement(node.value)
npm ERR!   File "/home/geeksha/mediasoup-demo/server/node_modules/mediasoup/worker/out/pip/mesonbuild/interpreterbase/interpreterbase.py", line 179, in evaluate_statement
npm ERR!     return self.function_call(cur)
npm ERR!   File "/home/geeksha/mediasoup-demo/server/node_modules/mediasoup/worker/out/pip/mesonbuild/interpreterbase/interpreterbase.py", line 454, in function_call
npm ERR!     res = func(node, func_args, kwargs)
npm ERR!   File "/home/geeksha/mediasoup-demo/server/node_modules/mediasoup/worker/out/pip/mesonbuild/interpreterbase/decorators.py", line 276, in wrapper
npm ERR!     return f(*nargs, **wrapped_kwargs)
npm ERR!   File "/home/geeksha/mediasoup-demo/server/node_modules/mediasoup/worker/out/pip/mesonbuild/interpreterbase/decorators.py", line 60, in wrapped
npm ERR!     return f(*wrapped_args, **wrapped_kwargs)
npm ERR!   File "/home/geeksha/mediasoup-demo/server/node_modules/mediasoup/worker/out/pip/mesonbuild/interpreter/interpreter.py", line 604, in func_files
npm ERR!     return [mesonlib.File.from_source_file(self.environment.source_dir, self.subdir, fname) for fname in args[0]]
npm ERR!   File "/home/geeksha/mediasoup-demo/server/node_modules/mediasoup/worker/out/pip/mesonbuild/interpreter/interpreter.py", line 604, in <listcomp>
npm ERR!     return [mesonlib.File.from_source_file(self.environment.source_dir, self.subdir, fname) for fname in args[0]]
npm ERR!   File "/home/geeksha/mediasoup-demo/server/node_modules/mediasoup/worker/out/pip/mesonbuild/mesonlib/universal.py", line 399, in from_source_file
npm ERR!     raise MesonException(f'File {fname} does not exist.')
npm ERR! mesonbuild.mesonlib.universal.MesonException: File srtp/srtp.c does not exist.
npm ERR! 
npm ERR! During handling of the above exception, another exception occurred:
npm ERR! 
npm ERR! Traceback (most recent call last):
npm ERR!   File "/home/geeksha/mediasoup-demo/server/node_modules/mediasoup/worker/out/pip/mesonbuild/mesonmain.py", line 148, in run
npm ERR!   File "/home/geeksha/mediasoup-demo/server/node_modules/mediasoup/worker/out/pip/mesonbuild/msetup.py", line 294, in run
npm ERR!   File "/home/geeksha/mediasoup-demo/server/node_modules/mediasoup/worker/out/pip/mesonbuild/msetup.py", line 185, in generate
npm ERR!   File "/home/geeksha/mediasoup-demo/server/node_modules/mediasoup/worker/out/pip/mesonbuild/msetup.py", line 231, in _generate
npm ERR!   File "/home/geeksha/mediasoup-demo/server/node_modules/mediasoup/worker/out/pip/mesonbuild/mintro.py", line 571, in write_meson_info_file
npm ERR! FileNotFoundError: [Errno 2] No such file or directory: '/home/geeksha/mediasoup-demo/server/node_modules/mediasoup/worker/out/Release/build/meson-info/tmp_dump.json'
npm ERR! make: *** [Makefile:85: setup] Error 2



sudo apt update -y
sudo apt upgrade -y

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
sudo npm install pm2@latest -g
sudo npm install -g npm@latest
sudo reboot

npm install mediasoup --save

Try these steps, some things are missing at first. The build-essential and python3-pip are required in our case.

Thanks, it works for me. I think my mistake was to select the version for python instead of the one from repositories.

Kind regards,

Beka

No problem, whether this is uBuntu 20 → 22.xx it should work just fine, things may update but that’s for a different day.