Error Installing mediasoup on windows

npm ERR! code 1
npm ERR! path X:\Projek\Mediasoup\node_modules\mediasoup
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node npm-scripts.js postinstall
npm ERR! npm-scripts.js [INFO] running task “postinstall”
npm ERR! npm-scripts.js [INFO] buildWorker()
npm ERR! npm-scripts.js [INFO] executeCmd(): make -C worker
npm ERR! # Updated pip and setuptools are needed for meson.
npm ERR! make: Leaving directory /x/Projek/Mediasoup/node_modules/mediasoup/worker' npm ERR! make: dirname: Command not found npm ERR! make: Entering directory /x/Projek/Mediasoup/node_modules/mediasoup/worker’
npm ERR! make: pwd: Command not found
npm ERR! make: pwd: Command not found
npm ERR! make: /bin/sh: Command not found
npm ERR! make: pwd: Command not found
npm ERR! make: /bin/sh: Command not found
npm ERR! make: pwd: Command not found
npm ERR! make: /bin/sh: Command not found
npm ERR! make: pwd: Command not found
npm ERR! make: /bin/sh: Command not found
npm ERR! make: pwd: Command not found
npm ERR! make: /bin/sh: Command not found
npm ERR! make: *** [meson-ninja] Error 127
npm ERR! npm-scripts.js [ERROR] executeCmd() failed, exiting: Error: Command failed: make -C worker

Can someone help me ? i dont know how to fix it, i got stuck for 6 hours looking for the answer. Please Help

Be sure to install all the required things before doing npm install:


Yep, i’ve already done that, but still it shows error
Node → v16.18.0
GNU Make → 3.81
python → 3.10.2

i already append the directory of make’s folder to path. But still it shows same errors

Kindly show the versions of all these from terminal to make sure, like node -v, make -v etc. Make sure to restart the terminal after you have added something to PATH.

Make sure to install PIP for python as well.

yeah, i always restart the terminal after added new directory to path

For the record, i’ve done all of these steps
1.install Node, Python, and PIP
2.install GNU make from MinGW (using link provided in [mediasoup :: Installation])
3.add C:\MinGW\msys\1.0\bin to path
4.i’ve tried use vcvars64.bat from VS2019 or VS2022 to run npm install

Oh, btw. which ‘make’ should i install ? Is it from MSYS or MinGW ?

From MSYS, looks all good to me. Which version of mediasoup you are installing? Can you try it with windows terminal application? Also remove node_modules and try again.

version 3 but i dont know the specific version of it (e.g : 3…) i just use ```
npm install mediasoup@3


okay, let me try it first

Here if i run it on powershell

CMD

CMD + VCVARS64.BAT

I see it now please do install these as well from under MSYS using MinGW manager:

First try with these:
msys-base
msys-bash
msys-core
msys-coreutils
msys-diffutils

And if shown some error then try installing these as well:
msys-dos2unix
msys-file
msys-findutils
msys-gawk
msys-grep
msys-gzip
msys-libint
msys-libiconv
msys-tar
msys-xz
msys-texinfo

But first confirm me whether you have pwd.exe inside MinGW/msys/1.0/bin?

i dont have it in my MinGW/msys/1.0/bin. Do i need to download it from the internet ?

Ok, no install it the same way you installed msys-make from MinGW application here:

Ok. :grin:

i’ve tried your suggestions .

First try with these:
msys-base
msys-bash
msys-core
msys-coreutils
msys-diffutils

It still shows errors but the errors is different

Looks like we are making progress. This time it is saying about not finding PIP. Can you try this command in terminal ‘python3 -m pip’?

1 Like

Well, after i try commnad ‘python3 -m pip’ in terminal. it shows exaxtly as in here [ mediasoup :: Installation]

Ok and what does ‘python3’ outputs? If it shows error then you need to add python3 to environment variable with python3 installation path.

So, I’ve faced the same issue, here’s the solution:
Most likely, you don’t have Visual Studio >=2015 (The Visual C++ Redistributable installs Microsoft C and C++ (MSVC) runtime libraries), it can be downloaded from here: Latest supported Visual C++ Redistributable downloads | Microsoft Learn.
Before installing it, i was receiving errors from meson. Also, check python, pip, node, and remember to “install ISRG Root X1 certificate , or you will get errors while downloading OpenSSL (whose website is secured with Let’s Encrypt), you can import it from https://letsencrypt.org/certs/isrgrootx1.der (install to Local computer).”