Failed at the mediasoup@3.6.18 postinstall script.

Hello, I have one week trying to install Mediasoup but without no result !!

node --version: v10.22.0
gcc   --version: gcc (GCC) 4.9.2
g++   --version: g++ (GCC) 4.9.2
make   --version: GNU Make 3.82
python   --version: Python 2.7.5

[youkous@lakkini EclassDB]*$ sudo npm install mediasoup@3 --unsafe-perm=true --allow-root

> clang-tools-prebuilt@0.1.4 postinstall /home/youkous/EclassDB/node_modules/clang-tools-prebuilt
> node install.js

Downloading clang-tools-r298696-linux.tgz
[============================================>] 100.0% of 40.98 MB (16.39 MB/s)
unziping /root/.clang-tools/clang-tools-r298696-linux.tgz

> mediasoup@3.6.18 postinstall /home/youkous/EclassDB/node_modules/mediasoup
> node npm-scripts.js postinstall

npm-scripts.js [INFO] running task "postinstall"
npm-scripts.js [INFO] executing command: make -C worker
make: Entering directory `/home/youkous/EclassDB/node_modules/mediasoup/worker'
/bin/python2 ./scripts/configure.py -R mediasoup-worker
Traceback (most recent call last):
  File "./scripts/configure.py", line 83, in <module>
    (major, minor), is_clang = compiler_version()
  File "./scripts/configure.py", line 36, in compiler_version
    proc = subprocess.Popen(CC.split() + ['--version'], stdout=subprocess.PIPE)
  File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/usr/lib64/python2.7/subprocess.py", line 1327, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
make: *** [default] Error 1
make: Leaving directory `/home/youkous/EclassDB/node_modules/mediasoup/worker'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mediasoup@3.6.18 postinstall: `node npm-scripts.js postinstall`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mediasoup@3.6.18 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

PS: i used the --unsafe-perm=true --allow-root cuz I had permission denied error.

Any suggestions, please!

Line 36 is cc --version execution, does this command run if you try it in the terminal?

Hello @nazar-pc, no the cc --version commande not found !!

is the cc and gcc not the same ?

cc is usually an alias/symlink for gcc or other compiler (can be clang) that OS configures for you when you install it (on Linux at least).
Try to find instructions for your OS on how to create an alias.

Also as a workaround you can try alias cc=”gcc” in the terminal.

do you mean this part in installation:

cc and c++ commands (symlinks) pointing to the corresponding gcc / g++ or clang / clang++ executables.

Yes, just Google or DuckDuckGo it

CC --version: CC (GCC) 4.9.2
C++ --version:  C++ (GCC) 4.9.2
type -a CC: CC is /usr/local/bin/CC
type -a C++: C++ is /usr/local/bin/C++
ls -l /usr/local/bin/CC
lrwxrwxrwx 1 root root 18 Sep  7 16:56 /usr/local/bin/CC -> /usr/local/bin/gcc
ls -l /usr/local/bin/g++
lrwxrwxrwx 1 root root 18 Sep  7 16:57 /usr/local/bin/C++ -> /usr/local/bin/g++

am i wrong in what i did?

cc and CC are different commands on Linux (by default). You need cc symlink.

cc --version: cc (GCC) 4.9.2
c++ --version:  c++ (GCC) 4.9.2
type -a cc: cc is /usr/local/bin/cc
type -a c++: c++ is /usr/local/bin/c++
ls -l /usr/local/bin/cc
lrwxrwxrwx 1 root root 18 Sep  7 17:11 /usr/local/bin/cc -> /usr/local/bin/gcc
ls -l /usr/local/bin/c++
lrwxrwxrwx 1 root root 18 Sep  7 17:11 /usr/local/bin/c++ -> /usr/local/bin/g++

I removed the symlinks for the CC and C++ and i replace them with cc and c++
is taht right !

They are supposed to be in lower case. Anyway, if you install the dev kit of your Linux distribution (as documented in the Installation page) you should be done instead of creating them manually

for the configuration i did right now, i tried to install the mediasoup as the documetation said but i got the same error that i posted it above!

so i guess the error was not the cc ?

I don’t know what you mean, sorry. BTW you have not even told which Linux distribution you use.

Linux Distro:

NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

@ibc To let you know:

1- I tried to install mediasoup:

sudo PYTHON=python2 npm install mediasoup@3 --save --unsafe-perm=true --allow-root

2- Error i got:

> clang-tools-prebuilt@0.1.4 postinstall /home/youkous/EclassDB/node_modules/clang-tools-prebuilt
> node install.js

unziping /root/.clang-tools/clang-tools-r298696-linux.tgz

> mediasoup@3.6.19 postinstall /home/youkous/EclassDB/node_modules/mediasoup
> node npm-scripts.js postinstall

npm-scripts.js [INFO] running task "postinstall"
npm-scripts.js [INFO] executing command: make -C worker
make: Entering directory /home/youkous/EclassDB/node_modules/mediasoup/worker'** **python2 ./scripts/configure.py -R mediasoup-worker** **Traceback (most recent call last):** ** File "./scripts/configure.py", line 83, in <module>** ** (major, minor), is_clang = compiler_version()** ** File "./scripts/configure.py", line 36, in compiler_version** ** proc = subprocess.Popen(CC.split() + ['--version'], stdout=subprocess.PIPE)** ** File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__** ** errread, errwrite)** ** File "/usr/lib64/python2.7/subprocess.py", line 1327, in _execute_child** ** raise child_exception** **OSError: [Errno 2] No such file or directory** **make: *** [default] Error 1** **make: Leaving directory /home/youkous/EclassDB/node_modules/mediasoup/worker’

i thought that was a cc --version line 36 error as @nazar-pc suggested, i create the symlink for the cc as i mentioned above, but i had the same error!

Apparently cc is not in $PATH for the process that is running compilation.

i changed the server and i worked on another server:

PYTHON=python2 npm install mediasoup@3 --save
  • The installation go normally for this time without any error
  • By the end i got an error that said:
g++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
make[1]: *** [deps/libwebrtc/libwebrtc.target.mk:125: /home/admin/node_modules/mediasoup/worker/out/Release/obj.target/libwebrtc/deps/libwebrtc/libwebrtc/system_wrappers/source/field_trial.o] Error 1
make[1]: Leaving directory '/home/admin/node_modules/mediasoup/worker/out'
make: *** [Makefile:24: default] Error 2
make: Leaving directory '/home/admin/node_modules/mediasoup/worker'

what does this mean !

Probably not enough memory in your server. Google is your friend:

https://www.google.com/search?q=fatal+error%3A+Killed+signal+terminated+program+cc1plus

IDK really what is the reason for that !!

I created a new droplet and test that again it took a very short time and the mediasoup installed as normal!

it will be my first try on that, hope that will be an easy and great adventure!

@ibc @nazar-pc thank you guys for your time!

#Still the reason not understandable!