MediaSoup Installation Error In Windows 10 in VsCode React Project


Please Help Me.

Did you read the documentation about installation requirements?: mediasoup :: Installation

Also see mediasoup 3.9.0 released (GYP replaced with Meson build system) - #5 by snnz, requirements are likely incomplete on Windows.

By the way, maybe it’s worth mentioning that the folder containing make should also be in the PATH. I noticed that the MinGW installer didn’t add it automatically.

Yeah, good idea. I was away for a few days, will try to make it work fully in a VM and will submit a documentation update PR with necessary instructions. Let me know if you want to take care of it instead.

BTW, I think it would be nice to rewrite Makefile in plain Python to reduce dependencies further.

1 Like

Truly saying, I just feel reluctant to delve into the Makefile. Actually running vcvars64.bat manually prior to npm install... solves the problem all right (providing that make is available).

OK, I will verify it and see if I can make Makefile find vcvars64.bat in some generic way automatically and will update docs accordingly.

PS D:\MeetApp-new\server> npm i

clang-tools-prebuilt@0.1.4 postinstall D:\MeetApp-new\server\node_modules\clang-tools-prebuilt
node install.js

D:\MeetApp-new\server\node_modules\clang-tools-prebuilt\install.js:24
if (!platforms[platform]) throw new Error('Unknown platform: ’ + platform)
^

Error: Unknown platform: win32
at Object. (D:\MeetApp-new\server\node_modules\clang-tools-prebuilt\install.js:24:33)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions…js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
at internal/main/run_main_module.js:17:47

mediasoup@3.7.0 postinstall D:\MeetApp-new\server\node_modules\mediasoup
node npm-scripts.js postinstall

npm-scripts.js [INFO] running task “postinstall”
npm-scripts.js [INFO] executing command: python ./worker/scripts/configure.py --format=msvs -R mediasoup-worker
D:\MeetApp-new\server\node_modules\mediasoup\worker\deps\gyp\pylib\gyp\input.py:1186: SyntaxWarning: “is” with a literal. Did you mean “==”?
if the_dict_key is ‘variables’ and variable_name in the_dict:
Traceback (most recent call last):
File “D:\MeetApp-new\server\node_modules\mediasoup\worker\scripts\configure.py”, line 20, in
import gyp
File “D:\MeetApp-new\server\node_modules\mediasoup\worker\deps\gyp\pylib\gyp_init_.py”, line 10, in
import gyp.input
File “D:\MeetApp-new\server\node_modules\mediasoup\worker\deps\gyp\pylib\gyp\input.py”, line 8, in
import gyp.common
File “D:\MeetApp-new\server\node_modules\mediasoup\worker\deps\gyp\pylib\gyp\common.py”, line 497, in
class OrderedSet(collections.MutableSet):
AttributeError: module ‘collections’ has no attribute ‘MutableSet’
npm WARN meet-app-server@1.0.0 No description
npm WARN meet-app-server@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.2.1 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.2.1: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“win32”,“arch”:“x64”})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“win32”,“arch”:“x64”})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: clang-tools-prebuilt@0.1.4 (node_modules\clang-tools-prebuilt):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: clang-tools-prebuilt@0.1.4 postinstall: node install.js
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mediasoup@3.7.0 postinstall: node npm-scripts.js postinstall
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mediasoup@3.7.0 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! C:\Users\Lenovo\AppData\Roaming\npm-cache_logs\2021-10-20T16_57_44_275Z-debug.log

PS D:\MeetApp-new\server> npm i mediasoup

mediasoup@3.9.0 postinstall D:\MeetApp-new\server\node_modules\mediasoup
node npm-scripts.js postinstall

npm-scripts.js [INFO] running task “postinstall”
npm-scripts.js [INFO] executing command: node npm-scripts.js worker:build
npm-scripts.js [INFO] running task “worker:build”
npm-scripts.js [INFO] executing command: make -C worker
process_begin: CreateProcess(NULL, dirname D:/MeetApp-new/server/node_modules/mediasoup/worker/Makefile, …) failed.
process_begin: CreateProcess(NULL, pwd, …) failed.
The system cannot find the path specified.
process_begin: CreateProcess(NULL, pwd, …) failed.
The system cannot find the path specified.
process_begin: CreateProcess(NULL, pwd, …) failed.
The system cannot find the path specified.
process_begin: CreateProcess(NULL, pwd, …) failed.
make: Entering directory ‘D:/MeetApp-new/server/node_modules/mediasoup/worker’

Updated pip and setuptools are needed for meson

process_begin: CreateProcess(NULL, pwd, …) failed.
process_begin: CreateProcess(NULL, pwd, …) failed.
process_begin: CreateProcess(NULL, # Updated pip and setuptools are needed for meson, …) failed.
make (e=2): The system cannot find the file specified.
Makefile:38: recipe for target ‘meson-ninja’ failed
make: *** [meson-ninja] Error 2
make: Leaving directory ‘D:/MeetApp-new/server/node_modules/mediasoup/worker’
npm WARN meet-app-server@1.0.0 No description
npm WARN meet-app-server@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.2.1 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.2.1: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“win32”,“arch”:“x64”})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“win32”,“arch”:“x64”})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mediasoup@3.9.0 postinstall: node npm-scripts.js postinstall
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mediasoup@3.9.0 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! C:\Users\Lenovo\AppData\Roaming\npm-cache_logs\2021-10-20T17_30_02_530Z-debug.log

The problem is clear, right? What about considering what the error says?

I am not getting what should i do can u help me

You are likely still on Python 2, while documentation I linked in the very first comment clearly says you need Python 3.

Actually I am Already Using Python3

Ah, so the first one was with older Mediasoup version that required Python 2 and it failed because you had Python 3. Now you install a newer version, so you need to follow extra instructions provided by Sergey above.

Hi @nazar-pc,
Thanks for pointing me here. I was able to get past LINK error after running the vcvars64.bat in the same cmd shell.

Running test binary command: C:\mediasoup\worker\out\Release\meson-private\sanitycheckcpp.exe
C++ compiler for the build machine: cl (msvc 19.29.30136 "Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30136 for x64")
C++ linker for the build machine: link link 14.29.30136.0
Build machine cpu family: x86_64
Build machine cpu: x86_64
Host machine cpu family: x86_64
Host machine cpu: x86_64
Target machine cpu family: x86_64
Target machine cpu: x86_64
Downloading openssl source from https://www.openssl.org/source/openssl-1.1.1l.tar.gz
<urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1108)>
A fallback URL could be specified using source_fallback_url key in the wrap file

meson.build:147:0: ERROR: could not get https://www.openssl.org/source/openssl-1.1.1l.tar.gz is the internet available?

The certificates are fine because the above url worked when I tried with curl even without using --insecure. Can I get past this by manually downloading and extracting this file? if so at what location?

On a different note: I was getting error with local install of meson and ninja, so I commented out the line #$(PYTHON) -m pip install --upgrade --target=$(PIP_DIR) meson ninja and copied meson and ninja files manually to the local folder.

Your system has old root SSL certificates making Let’s Encrypt-issued certificates not working. Make sure to have ISRG Root X1 in your certificates store (search on how to do that for your OS/setup, there are plenty of resources online and this is not mediasoup-specific).

1 Like

Yes, actually I figured this out that its not mediasoup specific. I manually copied subprojects and patches in the mediasoup\worker\subprojects folder. After that build succeeded :slight_smile: .

I am not sure why curl/browser works just fine but python refers to a different root certificates. I will dig little more.

Just to recap how I managed to get it compiled. I cannot write a doc as I am not expert, but these are the steps and the problems and how I resolved.

I use windows 10. python 3.8.1 with virtualenvwrapper-win==1.2.5. I am very new to vc++ builds.
I installed cmake seems that was not used. I installed make from gnuutils make-3.81-bin. That required additional libs like libintl-0.14.4-bin, I installed that as well, and thought this was going nowhere I don’t know how many more libs to come. So I decided to go with mingw. Reason I didn’t start with mingw is because it has gcc, cc, etc so I thought it will mess up with visual studio compilers (cl.exe), which kind of happened with the linkers but I got past that by setting the vc++ before mingw in the PATH.

Downloaded mingw-w64-install.exe from Downloads - Mingw-w64. Extracted and added to user PATH.
Downloaded vs_buildtools__1325967035.1634799115.exe from Thank you for downloading Visual Studio - Visual Studio.

This is what I have in PATH variables in this order: Order is important otherwise the linker of mingw was being picked up instead of VC tools.

C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin (Probably this is not needed but I had it from some previous
npm install --global windows-build-tools)
C:\mingw\bin

For me pip install in a specific directory mediasoup\worker\out\pip\bin did not work. It kept on messing up with forward slashes and backslashes. I tried copying just meson and ninja executables to this directory. Which gave another error of pip modules, I can’t remember exactly what it was now But I decided to install meson and ninja globally in a new python virtual environment.

I was getting linker error, msvcrt.dll missing at this point.

I was wondering how to provide lib path LIBRARY_PATH, LD_LIBRARY_PATH variables did not work. Then @snnz suggestion worked.
I ran in the shell where I was working. C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat

Now I started getting meson subprojects download error due to invalid ssl certs. Google did not return a lot help here, but it did mention about the warp thing. Initially I ignored it thinking its not related. But its quite opposite. I ran meson subprojects download now and could isolate this problem, only half of the projects downloaded. I ended up opening each wrap file, eg. openssl.warp. Then manually downloaded the source and the patches. Went and checked each folder and ensured it contains meson.build file. These build files comes from warp patches https://mesonbuild.com/Wrapdb-projects.html.

Interestingly it worked, only one last issue windows cmd returned forwars slash paths, so I ran sh.exe and went into a unix like shell and ran the below cmd.

sh-4.4$ meson compile -j 1 -C /c/myprojects/telemed/mediasoup/worker/out/Release mediasoup-worker

After it compiled 970 files, there I have mediasoup\worker\out\Release\mediasoup-worker.exe.

I am yet to run a sample project, hopefully that works.

We actually specifically prefer cl.exe on Windows instead of regular cc/c++, so that MinGW works.

I will analyze all of the above, will improve Makefile to work without most of those steps and will later also update instructions in documentation. Might take some time, but I’ll get to it.

Thanks for the testing and detailed report!

I did little bit more fiddling around. Few of my previous words I have to take back. gnuutils make works. make-deps needs to be extracted in the bin. This worked for me also if you don’t want full blown mingw32.

C:\softwares\make\bin>ls
libiconv2.dll  libintl3.dll  make.exe

Also there is nothing wrong with this command c:\>python -m pip install --upgrade --target=c:/mediasoup-sample-app/node_modules/mediasoup/worker/out/pip meson ninja. I am still not sure why this pip command was not getting triggered after I changed the output path as below. May be something for cached somewhere.

I modified the Makefile a bit to get the c:/mediasoup path instead of /c/mediasoup kind of path because
meson compile -j 1 -C c:/mediasoup-sample-app/node_modules/mediasoup/worker/out/Release mediasoup-worker command will always fail unless I run it in some unix like shell eg. git-bash or so.

Makefile:
----------------
ifeq ($(OS),Windows_NT)
MEDIASOUP_OUT_DIR ?= $(shell pwd| sed -E 's/^\/([[:alpha:]])/\1\:/' )/out
else
MEDIASOUP_OUT_DIR ?= $(shell pwd)/out
endif

Regarding the ssl certificate issue. That is not related but I managed to fix it by adding an environment variable SSL_CERT_FILE=C:\Users\suser>Envs\p38\lib\site-packages\certifi\cacert.pem
, this certificate is managed by certifi and appended the
intermediate certificate s of the chain of the root ISRG Root X1 .

Thanks

Hey folks, I prepared 2 PRs that should help everyone to get mediasoup working on Windows:

I would appreciate some testing and confirmation (documentation updates include fixes for Let’s Encrypt certificates too).

hi …
my vcvars64.bat is located in:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build

and i added this folder to windows env.

but cant access to it in project folder … can you help me how can i run prior to npm i ?