error during npm install

Hello everyone, everything good? I’m starting to study mediasoup to test its viability in a future project. However, I’m having trouble getting it to run. Can someone help me? follow error during npm install

The Meson build system
Version: 0.61.5
Source dir: /Users/marcdes/Documents/mirotalksfu/node_modules/mediasoup/worker
Build dir: /Users/marcdes/Documents/mirotalksfu/node_modules/mediasoup/worker/out/Release/build
Build type: native build
Project name: mediasoup-worker
Project version: undefined
C compiler for the host machine: cc (clang 14.0.0 "Apple clang version 14.0.0 (clang-1400.0.29.202)")
C linker for the host machine: cc ld64 820.1
C++ compiler for the host machine: c++ (clang 14.0.0 "Apple clang version 14.0.0 (clang-1400.0.29.202)")
C++ linker for the host machine: c++ ld64 820.1
Host machine cpu family: aarch64
Host machine cpu: arm64
Downloading openssl source from https://www.openssl.org/source/openssl-3.0.7.tar.gz
<urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:992)>
A fallback URL could be specified using source_fallback_url key in the wrap file

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

A full log can be found at /Users/marcdes/Documents/mirotalksfu/node_modules/mediasoup/worker/out/Release/build/meson-logs/meson-log.txt
make: *** [Makefile:110: setup] Error 1
make: Leaving directory '/Users/marcdes/Documents/mirotalksfu/node_modules/mediasoup/worker'
npm-scripts.js [ERROR] executeCmd() failed, exiting: Error: Command failed: make -C worker

Yes! I tried several times, I even downloaded and manually installed the package and so far nothing

Make sure to install openssl root certificate as mentioned in the docs:

I already have the certificate installed

Can you mention the versions of these: python, node, make? Mention the mediasoup version you are installing. Also share the full logs from console.

make: GNU Make 4.4
node: v16.16.0
Python 3.11.1

info No lockfile found.
[1/4] 🔍  Resolving packages...
warning mediasoup-client > uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 🔨  Building fresh packages...
[1/2] ⠁ mediasoup
error /Users/marcdes/Documents/mirotalksfu/node_modules/mediasoup: Command failed.
Exit code: 1
Command: node npm-scripts.js postinstall
Arguments:
Directory: /Users/marcdes/Documents/mirotalksfu/node_modules/mediasoup
Output:
npm-scripts.js [INFO] running task "postinstall"
npm-scripts.js [INFO] buildWorker()
npm-scripts.js [INFO] executeCmd(): make -C worker
make: Entering directory '/Users/marcdes/Documents/mirotalksfu/node_modules/mediasoup/worker'
# Updated pip and setuptools are needed for meson.
# `--system` is not present everywhere and is only needed as workaround for
# Debian-specific issue (copied from https://github.com/gluster/gstatus/pull/33),
# fallback to command without `--system` if the first one fails.
/Library/Frameworks/Python.framework/Versions/3.11/bin/python3 -m pip install --system --target=/Users/marcdes/Documents/mirotalksfu/node_modules/mediasoup/worker/out/pip pip setuptools || \
	/Library/Frameworks/Python.framework/Versions/3.11/bin/python3 -m pip install --target=/Users/marcdes/Documents/mirotalksfu/node_modules/mediasoup/worker/out/pip pip setuptools || \
	echo "Installation failed, likely because PIP is unavailable, if you are on Debian/Ubuntu or derivative please install the python3-pip package"

Usage:
  /Library/Frameworks/Python.framework/Versions/3.11/bin/python3 -m pip install [options] <requirement specifier> [package-index-options] ...
  /Library/Frameworks/Python.framework/Versions/3.11/bin/python3 -m pip install [options] -r <requirements file> [package-index-options] ...
  /Library/Frameworks/Python.framework/Versions/3.11/bin/python3 -m pip install [options] [-e] <vcs project url> ...
  /Library/Frameworks/Python.framework/Versions/3.11/bin/python3 -m pip install [options] [-e] <local project path> ...
  /Library/Frameworks/Python.framework/Versions/3.11/bin/python3 -m pip install [options] <archive url/path> ...

no such option: --system
Collecting pip
  Using cached pip-22.3.1-py3-none-any.whl (2.1 MB)
Collecting setuptools
  Using cached setuptools-67.0.0-py3-none-any.whl (1.1 MB)
Installing collected packages: setuptools, pip
Successfully installed pip-22.3.1 setuptools-67.0.0
# Install `meson` and `ninja` using `pip` into custom location, so we don't
# depend on system-wide installation.
/Library/Frameworks/Python.framework/Versions/3.11/bin/python3 -m pip install --upgrade --target=/Users/marcdes/Documents/mirotalksfu/node_modules/mediasoup/worker/out/pip  meson==0.61.5 ninja==1.10.2.4
Collecting meson==0.61.5
  Using cached meson-0.61.5-py3-none-any.whl (862 kB)
Collecting ninja==1.10.2.4
  Using cached ninja-1.10.2.4-py2.py3-none-macosx_10_9_universal2.macosx_10_9_x86_64.macosx_11_0_arm64.macosx_11_0_universal2.whl (231 kB)
Installing collected packages: ninja, meson
Successfully installed meson-0.61.5 ninja-1.10.2.4
/Users/marcdes/Documents/mirotalksfu/node_modules/mediasoup/worker/out/pip/bin/meson setup \
	--prefix /Users/marcdes/Documents/mirotalksfu/node_modules/mediasoup/worker/out/Release \
	--bindir '' \
	--libdir '' \
	--buildtype release \
	-Db_ndebug=true \
	-Db_pie=true \
	-Db_staticpic=true \
	--reconfigure \
	"" \
	/Users/marcdes/Documents/mirotalksfu/node_modules/mediasoup/worker/out/Release/build || \
	/Users/marcdes/Documents/mirotalksfu/node_modules/mediasoup/worker/out/pip/bin/meson setup \
		--prefix /Users/marcdes/Documents/mirotalksfu/node_modules/mediasoup/worker/out/Release \
		--bindir '' \
		--libdir '' \
		--buildtype release \
		-Db_ndebug=true \
		-Db_pie=true \
		-Db_staticpic=true \
		"" \
		/Users/marcdes/Documents/mirotalksfu/node_modules/mediasoup/worker/out/Release/build
Directory does not contain a valid build tree:
/Users/marcdes/Documents/mirotalksfu/node_modules/mediasoup/worker/out/Release/build
The Meson build system
Version: 0.61.5
Source dir: /Users/marcdes/Documents/mirotalksfu/node_modules/mediasoup/worker
Build dir: /Users/marcdes/Documents/mirotalksfu/node_modules/mediasoup/worker/out/Release/build
Build type: native build
Project name: mediasoup-worker
Project version: undefined
C compiler for the host machine: cc (clang 14.0.0 "Apple clang version 14.0.0 (clang-1400.0.29.202)")
C linker for the host machine: cc ld64 820.1
C++ compiler for the host machine: c++ (clang 14.0.0 "Apple clang version 14.0.0 (clang-1400.0.29.202)")
C++ linker for the host machine: c++ ld64 820.1
Host machine cpu family: aarch64
Host machine cpu: arm64
Downloading openssl source from https://www.openssl.org/source/openssl-3.0.7.tar.gz
<urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:992)>
A fallback URL could be specified using source_fallback_url key in the wrap file

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

A full log can be found at /Users/marcdes/Documents/mirotalksfu/node_modules/mediasoup/worker/out/Release/build/meson-logs/meson-log.txt
make: *** [Makefile:110: setup] Error 1
make: Leaving directory '/Users/marcdes/Documents/mirotalksfu/node_modules/mediasoup/worker'
npm-scripts.js [ERROR] executeCmd() failed, exiting: Error: Command failed: make -C worker

Mediasoup version?

The is snapshot from my system it says ‘System Root’ under keychain column. While the picture you shared is saying only ‘System’ plus it is saying ‘This certificate is valid for current user’. So try enabling this keychain system root it should solve the issue.

Also try with reinstalling the certificate, I don’t remember installing this certificate manually on my mac, and it is not mentioned in docs as well.

This person have same issue, check the topic:

Check this as well:

as described in the suggested topic, the solution was to run the command below to work.

cd /Applications/Python\ 3.11
./Install\ Certificates.command

very grateful @zaidiqbal for the great help.

1 Like

Great :+1:

Hi, i am getting an error when tried to run npm install, I have installed python3.8
npm ERR! code 1
npm ERR! path C:\Users\1031866\Mediasoup-audio-sample\server\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] installMsysMake()
npm ERR! npm-scripts.js [INFO] executeCmd(): C:\Users\1031866\AppData\Local\Microsoft\WindowsApps\python3.exe worker\scripts\getmake.py
npm ERR! Traceback (most recent call last):
npm ERR! File “C:\Users\1031866\Mediasoup-audio-sample\server\node_modules\mediasoup\worker\scripts\getmake.py”, line 10, in
npm ERR! get(‘Download msysCORE-1.0.19-1-msys-1.0.19-bin.tar.xz (MinGW - Minimalist GNU for Windows)’, ‘8c4157d739a460f85563bc4451e9f1bbd42b13c4f63770d43b9f45a781f07858’)
npm ERR! File “C:\Users\1031866\Mediasoup-audio-sample\server\node_modules\mediasoup\worker\scripts\getmake.py”, line 4, in get
npm ERR! data = urllib.request.urlopen(url).read()
npm ERR! File “C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2800.0_x64__qbz5n2kfra8p0\lib\urllib\request.py”, line 216, in urlopen
npm ERR! return opener.open(url, data, timeout)
npm ERR! File “C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2800.0_x64__qbz5n2kfra8p0\lib\urllib\request.py”, line 525, in open
npm ERR! response = meth(req, response)
npm ERR! File “C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2800.0_x64__qbz5n2kfra8p0\lib\urllib\request.py”, line 634, in http_response
npm ERR! response = self.parent.error(
npm ERR! File “C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2800.0_x64__qbz5n2kfra8p0\lib\urllib\request.py”, line 563, in error
npm ERR! return self._call_chain(*args)
npm ERR! File “C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2800.0_x64__qbz5n2kfra8p0\lib\urllib\request.py”, line 496, in _call_chain
npm ERR! result = func(*args)
npm ERR! File “C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2800.0_x64__qbz5n2kfra8p0\lib\urllib\request.py”, line 643, in http_error_default
npm ERR! raise HTTPError(req.full_url, code, msg, hdrs, fp)
npm ERR! urllib.error.HTTPError: HTTP Error 403: Forbidden
npm ERR! npm-scripts.js [ERROR] executeCmd() failed, exiting: Error: Command failed: C:\Users\1031866\AppData\Local\Microsoft\WindowsApps\python3.exe worker\scripts\getmake.py

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\1031866\AppData\Local\npm-cache_logs\2023-03-20T05_47_13_180Z-debug-0.log