Error "npm install" with "Mediasoup-demo"

Hi,

I want to install the demo but after the “npm install” command I get this error:

How can I fix?
Thank you

[example@serve server]$ npm install
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.

> clang-tools-prebuilt@0.1.4 postinstall /home/example/public_html/demo/mediasoupDemo/server/node_modules/clang-tools-prebuilt
> node install.js

unziping /home/example/.clang-tools/clang-tools-r298696-linux.tgz

> mediasoup@3.5.11 postinstall /home/example/public_html/demo/mediasoupDemo/server/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/example/public_html/demo/mediasoupDemo/server/node_modules/mediasoup/worker'
/usr/bin/python2 ./scripts/configure.py -R mediasoup-worker
Traceback (most recent call last):
  File "./scripts/configure.py", line 87, in <module>
    raise RuntimeError('gcc <= 4.8 not supported, please upgrade your gcc')
RuntimeError: gcc <= 4.8 not supported, please upgrade your gcc
make: *** [default] Error 1
make: Leaving directory `/home/example/public_html/demo/mediasoupDemo/server/node_modules/mediasoup/worker'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mediasoup@3.5.11 postinstall: `node npm-scripts.js postinstall`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mediasoup@3.5.11 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/example/.npm/_logs/2020-05-12T13_20_16_233Z-debug.log
[example@serve server]$ npm install
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.

> clang-tools-prebuilt@0.1.4 postinstall /home/example/public_html/demo/mediasoupDemo/server/node_modules/clang-tools-prebuilt
> node install.js

unziping /home/example/.clang-tools/clang-tools-r298696-linux.tgz

> mediasoup@3.5.11 postinstall /home/example/public_html/demo/mediasoupDemo/server/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/example/public_html/demo/mediasoupDemo/node_modules/mediasoup/worker'
/usr/bin/python2 ./scripts/configure.py -R mediasoup-worker
Traceback (most recent call last):
  File "./scripts/configure.py", line 87, in <module>
    raise RuntimeError('gcc <= 4.8 not supported, please upgrade your gcc')
RuntimeError: gcc <= 4.8 not supported, please upgrade your gcc
make: *** [default] Error 1
make: Leaving directory `/home/example/public_html/demo/mediasoupDemo/server/node_modules/mediasoup/worker'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mediasoup@3.5.11 postinstall: `node npm-scripts.js postinstall`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mediasoup@3.5.11 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/example/.npm/_logs/2020-05-12T13_20_55_430Z-debug.log

GCC Version:

[root@serve ~]# gcc --version
gcc (GCC) 9.1.1 20190605 (Red Hat 9.1.1-2)
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Run and paste the output of:

  • gcc --version
  • g++ --version
  • cc --version
  • c++ --version

Versions:

[root@serve ~]# gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[root@serve ~]# g++ --version
g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[root@serve ~]# cc --version
cc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[root@serve ~]# c++ --version
c++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Well, so it’s easy, right?

    raise RuntimeError('gcc <= 4.8 not supported, please upgrade your gcc')
RuntimeError: gcc <= 4.8 not supported, please upgrade your gcc

BTW did you actually read the Installation requirements?

I noticed the problem. GCC versions on SSH connection with root.
When I run “npm install” command with user account, version 4.8 shows.

I entered the following command from the user account

scl enable devtoolset-8 - bash

And the version has changed.
Thank you