I'm trying to `npm install mediasoup` on Mac, but failed

I found a similar thread, but not really my issue here

While trying to install the mediasoup and after the “npm install mediasoup” command I get this error:

> mediasoup@3.10.0 postinstall /Users/mohamedriyad/Documents/JavaScript/mediasoup-demo/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
# 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.10/bin/python3 -m pip install --system --target=/Users/mohamedriyad/Documents/JavaScript/mediasoup-demo/server/node_modules/mediasoup/worker/out/pip pip setuptools || \
		/Library/Frameworks/Python.framework/Versions/3.10/bin/python3 -m pip install --target=/Users/mohamedriyad/Documents/JavaScript/mediasoup-demo/server/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.10/bin/python3 -m pip install [options] <requirement specifier> [package-index-options] ...
  /Library/Frameworks/Python.framework/Versions/3.10/bin/python3 -m pip install [options] -r <requirements file> [package-index-options] ...
  /Library/Frameworks/Python.framework/Versions/3.10/bin/python3 -m pip install [options] [-e] <vcs project url> ...
  /Library/Frameworks/Python.framework/Versions/3.10/bin/python3 -m pip install [options] [-e] <local project path> ...
  /Library/Frameworks/Python.framework/Versions/3.10/bin/python3 -m pip install [options] <archive url/path> ...

no such option: --system
Collecting pip
  Using cached pip-22.1.2-py3-none-any.whl (2.1 MB)
Collecting setuptools
  Using cached setuptools-62.6.0-py3-none-any.whl (1.2 MB)
Installing collected packages: setuptools, pip
Successfully installed pip-22.1.2 setuptools-62.6.0
WARNING: You are using pip version 21.2.4; however, version 22.1.2 is available.
You should consider upgrading via the '/Library/Frameworks/Python.framework/Versions/3.10/bin/python3 -m pip install --upgrade pip' command.
# Install `meson` and `ninja` using `pip` into custom location, so we don't
# depend on system-wide installation.
/Library/Frameworks/Python.framework/Versions/3.10/bin/python3 -m pip install --upgrade --target=/Users/mohamedriyad/Documents/JavaScript/mediasoup-demo/server/node_modules/mediasoup/worker/out/pip  meson ninja
Collecting meson
  Using cached meson-0.62.2-py3-none-any.whl (864 kB)
Collecting ninja
  Using cached ninja-1.10.2.3-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.62.2 ninja-1.10.2.3
/Users/mohamedriyad/Documents/JavaScript/mediasoup-demo/server/node_modules/mediasoup/worker/out/pip/bin/meson setup \
		--prefix /Users/mohamedriyad/Documents/JavaScript/mediasoup-demo/server/node_modules/mediasoup/worker/out/Release \
		--bindir '' \
		--libdir '' \
		--buildtype release \
		-Db_ndebug=true \
		-Db_pie=true \
		-Db_staticpic=true \
		--reconfigure \
		"" \
		/Users/mohamedriyad/Documents/JavaScript/mediasoup-demo/server/node_modules/mediasoup/worker/out/Release/build || \
		/Users/mohamedriyad/Documents/JavaScript/mediasoup-demo/server/node_modules/mediasoup/worker/out/pip/bin/meson setup \
			--prefix /Users/mohamedriyad/Documents/JavaScript/mediasoup-demo/server/node_modules/mediasoup/worker/out/Release \
			--bindir '' \
			--libdir '' \
			--buildtype release \
			-Db_ndebug=true \
			-Db_pie=true \
			-Db_staticpic=true \
			"" \
			/Users/mohamedriyad/Documents/JavaScript/mediasoup-demo/server/node_modules/mediasoup/worker/out/Release/build
Directory does not contain a valid build tree:
/Users/mohamedriyad/Documents/JavaScript/mediasoup-demo/server/node_modules/mediasoup/worker/out/Release/build
The Meson build system
Version: 0.62.2
Source dir: /Users/mohamedriyad/Documents/JavaScript/mediasoup-demo/server/node_modules/mediasoup/worker
Build dir: /Users/mohamedriyad/Documents/JavaScript/mediasoup-demo/server/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 13.0.0 "Apple clang version 13.0.0 (clang-1300.0.29.3)")
C linker for the host machine: cc ld64 711
C++ compiler for the host machine: c++ (clang 13.0.0 "Apple clang version 13.0.0 (clang-1300.0.29.3)")
C++ linker for the host machine: c++ ld64 711
Host machine cpu family: x86_64
Host machine cpu: x86_64

meson.build:29:3: ERROR: Tried to access unknown option 'ms_log_trace'.

A full log can be found at /Users/mohamedriyad/Documents/JavaScript/mediasoup-demo/server/node_modules/mediasoup/worker/out/Release/build/meson-logs/meson-log.txt
make: *** [setup] Error 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mediasoup@3.10.0 postinstall: `node npm-scripts.js postinstall`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the mediasoup@3.10.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!     /Users/mohamedriyad/.npm/_logs/2022-06-25T19_04_30_267Z-debug.log
mohamedriyad@Mohameds-MacBook-Pro server % make -v
GNU Make 3.81
Copyright (C) 2006  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.

This program built for i386-apple-darwin11.3.0
mohamedriyad@Mohameds-MacBook-Pro server % clear            

mohamedriyad@Mohameds-MacBook-Pro server % npm install mediasoup
zsh: command not found: npm
mohamedriyad@Mohameds-MacBook-Pro server % npm install mediasoup
zsh: command not found: npm
mohamedriyad@Mohameds-MacBook-Pro server % npm    
zsh: command not found: npm
mohamedriyad@Mohameds-MacBook-Pro server % sudo apt-get install npm
Password:
sudo: apt-get: command not found
mohamedriyad@Mohameds-MacBook-Pro server % brew install node
node 18.0.0 is already installed but outdated (so it will be upgraded).
==> Downloading https://ghcr.io/v2/homebrew/core/node/manifests/18.4.0
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/node/blobs/sha256:5be17d68e419e
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Upgrading node
  18.0.0 -> 18.4.0 

==> Pouring node--18.4.0.monterey.bottle.tar.gz
🍺  /usr/local/Cellar/node/18.4.0: 1,926 files, 49.2MB
==> Running `brew cleanup node`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
Removing: /usr/local/Cellar/node/18.0.0... (1,929 files, 49.0MB)
mohamedriyad@Mohameds-MacBook-Pro server % node -v
v18.4.0
mohamedriyad@Mohameds-MacBook-Pro server % npm install mediasoup   
npm ERR! code 1
npm ERR! git dep preparation failed
npm ERR! command /usr/local/Cellar/node/18.4.0/bin/node /usr/local/lib/node_modules/npm/bin/npm-cli.js install --force --cache=/Users/mohamedriyad/.npm --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit --include=dev --include=peer --include=optional --no-package-lock-only --no-dry-run
npm ERR! > mediasoup@3.10.0 postinstall
npm ERR! > node npm-scripts.js postinstall
npm ERR! 
npm ERR! npm-scripts.js [INFO] running task "postinstall"
npm ERR! npm-scripts.js [INFO] executing command: node npm-scripts.js worker:build
npm ERR! npm-scripts.js [INFO] running task "worker:build"
npm ERR! npm-scripts.js [INFO] executing command: make -C worker
npm ERR! # Updated pip and setuptools are needed for meson
npm ERR! # `--system` is not present everywhere and is only needed as workaround for
npm ERR! # Debian-specific issue (copied from
npm ERR! # https://github.com/gluster/gstatus/pull/33), fallback to command without
npm ERR! # `--system` if the first one fails.
npm ERR! /Library/Frameworks/Python.framework/Versions/3.10/bin/python3 -m pip install --system --target=/Users/mohamedriyad/.npm/_cacache/tmp/git-clone9MOEp2/worker/out/pip pip setuptools || \
npm ERR! 		/Library/Frameworks/Python.framework/Versions/3.10/bin/python3 -m pip install --target=/Users/mohamedriyad/.npm/_cacache/tmp/git-clone9MOEp2/worker/out/pip pip setuptools || \
npm ERR! 		echo "Installation failed, likely because PIP is unavailable, if you are on Debian/Ubuntu or derivative please install the python3-pip package"
npm ERR! Collecting pip
npm ERR!   Using cached pip-22.1.2-py3-none-any.whl (2.1 MB)
npm ERR! Collecting setuptools
npm ERR!   Using cached setuptools-62.6.0-py3-none-any.whl (1.2 MB)
npm ERR! Installing collected packages: setuptools, pip
npm ERR! Successfully installed pip-22.1.2 setuptools-62.6.0
npm ERR! # Install `meson` and `ninja` using `pip` into custom location, so we don't
npm ERR! # depend on system-wide installation.
npm ERR! /Library/Frameworks/Python.framework/Versions/3.10/bin/python3 -m pip install --upgrade --target=/Users/mohamedriyad/.npm/_cacache/tmp/git-clone9MOEp2/worker/out/pip  meson ninja
npm ERR! Collecting meson
npm ERR!   Using cached meson-0.62.2-py3-none-any.whl (864 kB)
npm ERR! Collecting ninja
npm ERR!   Using cached ninja-1.10.2.3-py2.py3-none-macosx_10_9_universal2.macosx_10_9_x86_64.macosx_11_0_arm64.macosx_11_0_universal2.whl (231 kB)
npm ERR! Installing collected packages: ninja, meson
npm ERR! Successfully installed meson-0.62.2 ninja-1.10.2.3
npm ERR! /Users/mohamedriyad/.npm/_cacache/tmp/git-clone9MOEp2/worker/out/pip/bin/meson setup \
npm ERR! 		--prefix /Users/mohamedriyad/.npm/_cacache/tmp/git-clone9MOEp2/worker/out/Release \
npm ERR! 		--bindir '' \
npm ERR! 		--libdir '' \
npm ERR! 		--buildtype release \
npm ERR! 		-Db_ndebug=true \
npm ERR! 		-Db_pie=true \
npm ERR! 		-Db_staticpic=true \
npm ERR! 		--reconfigure \
npm ERR! 		"" \
npm ERR! 		/Users/mohamedriyad/.npm/_cacache/tmp/git-clone9MOEp2/worker/out/Release/build || \
npm ERR! 		/Users/mohamedriyad/.npm/_cacache/tmp/git-clone9MOEp2/worker/out/pip/bin/meson setup \
npm ERR! 			--prefix /Users/mohamedriyad/.npm/_cacache/tmp/git-clone9MOEp2/worker/out/Release \
npm ERR! 			--bindir '' \
npm ERR! 			--libdir '' \
npm ERR! 			--buildtype release \
npm ERR! 			-Db_ndebug=true \
npm ERR! 			-Db_pie=true \
npm ERR! 			-Db_staticpic=true \
npm ERR! 			"" \
npm ERR! 			/Users/mohamedriyad/.npm/_cacache/tmp/git-clone9MOEp2/worker/out/Release/build
npm ERR! The Meson build system
npm ERR! Version: 0.62.2
npm ERR! Source dir: /Users/mohamedriyad/.npm/_cacache/tmp/git-clone9MOEp2/worker
npm ERR! Build dir: /Users/mohamedriyad/.npm/_cacache/tmp/git-clone9MOEp2/worker/out/Release/build
npm ERR! Build type: native build
npm ERR! Project name: mediasoup-worker
npm ERR! Project version: undefined
npm ERR! C compiler for the host machine: cc (clang 13.0.0 "Apple clang version 13.0.0 (clang-1300.0.29.3)")
npm ERR! C linker for the host machine: cc ld64 711
npm ERR! C++ compiler for the host machine: c++ (clang 13.0.0 "Apple clang version 13.0.0 (clang-1300.0.29.3)")
npm ERR! C++ linker for the host machine: c++ ld64 711
npm ERR! Host machine cpu family: x86_64
npm ERR! Host machine cpu: x86_64
npm ERR! Downloading openssl source from https://www.openssl.org/source/openssl-3.0.2.tar.gz
npm ERR! <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)>
npm ERR! WARNING: failed to download with error: could not get https://www.openssl.org/source/openssl-3.0.2.tar.gz is the internet available?. Trying after a delay...
npm ERR! <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)>
npm ERR! WARNING: failed to download with error: could not get https://www.openssl.org/source/openssl-3.0.2.tar.gz is the internet available?. Trying after a delay...
npm ERR! <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)>
npm ERR! WARNING: failed to download with error: could not get https://www.openssl.org/source/openssl-3.0.2.tar.gz is the internet available?. Trying after a delay...
npm ERR! <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)>
npm ERR! WARNING: failed to download with error: could not get https://www.openssl.org/source/openssl-3.0.2.tar.gz is the internet available?. Trying after a delay...
npm ERR! <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)>
npm ERR! WARNING: failed to download with error: could not get https://www.openssl.org/source/openssl-3.0.2.tar.gz is the internet available?. Trying after a delay...
npm ERR! <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)>
npm ERR! A fallback URL could be specified using source_fallback_url key in the wrap file
npm ERR! 
npm ERR! meson.build:161:0: ERROR: could not get https://www.openssl.org/source/openssl-3.0.2.tar.gz is the internet available?
npm ERR! 
npm ERR! A full log can be found at /Users/mohamedriyad/.npm/_cacache/tmp/git-clone9MOEp2/worker/out/Release/build/meson-logs/meson-log.txt
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! 
npm ERR! Usage:   
npm ERR!   /Library/Frameworks/Python.framework/Versions/3.10/bin/python3 -m pip install [options] <requirement specifier> [package-index-options] ...
npm ERR!   /Library/Frameworks/Python.framework/Versions/3.10/bin/python3 -m pip install [options] -r <requirements file> [package-index-options] ...
npm ERR!   /Library/Frameworks/Python.framework/Versions/3.10/bin/python3 -m pip install [options] [-e] <vcs project url> ...
npm ERR!   /Library/Frameworks/Python.framework/Versions/3.10/bin/python3 -m pip install [options] [-e] <local project path> ...
npm ERR!   /Library/Frameworks/Python.framework/Versions/3.10/bin/python3 -m pip install [options] <archive url/path> ...
npm ERR! 
npm ERR! no such option: --system
npm ERR! WARNING: You are using pip version 21.2.4; however, version 22.1.2 is available.
npm ERR! You should consider upgrading via the '/Library/Frameworks/Python.framework/Versions/3.10/bin/python3 -m pip install --upgrade pip' command.
npm ERR! Directory does not contain a valid build tree:
npm ERR! /Users/mohamedriyad/.npm/_cacache/tmp/git-clone9MOEp2/worker/out/Release/build
npm ERR! make: *** [setup] Error 1
npm ERR! npm ERR! code 1
npm ERR! npm ERR! path /Users/mohamedriyad/.npm/_cacache/tmp/git-clone9MOEp2
npm ERR! npm ERR! command failed
npm ERR! npm ERR! command sh -c node npm-scripts.js postinstall
npm ERR! 
npm ERR! npm ERR! A complete log of this run can be found in:
npm ERR! npm ERR!     /Users/mohamedriyad/.npm/_logs/2022-06-25T19_32_17_246Z-debug-0.log

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/mohamedriyad/.npm/_logs/2022-06-25T19_32_07_778Z-debug-0.log

Probably python or pip is missing on your system you first need to install them as mentioned in mediasoup docs, please make sure you are following all the steps mentioned here in docs:

Both python and pip are installed

Here’s the terminal output in more direct way (since the one I posted above has more than one command)

mohamedriyad@Mohameds-MacBook-Pro server % PYTHON=python3.9 npm install
npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm ERR! code 1
npm ERR! path /Users/mohamedriyad/Documents/JavaScript/mediasoup-demo/server/node_modules/mediasoup
npm ERR! command failed
npm ERR! command sh -c node npm-scripts.js postinstall
npm ERR! npm-scripts.js [INFO] running task "postinstall"
npm ERR! npm-scripts.js [INFO] executing command: node npm-scripts.js worker:build
npm ERR! npm-scripts.js [INFO] running task "worker:build"
npm ERR! npm-scripts.js [INFO] executing command: make -C worker
npm ERR! # Updated pip and setuptools are needed for meson
npm ERR! # `--system` is not present everywhere and is only needed as workaround for
npm ERR! # Debian-specific issue (copied from
npm ERR! # https://github.com/gluster/gstatus/pull/33), fallback to command without
npm ERR! # `--system` if the first one fails.
npm ERR! python3.9 -m pip install --system --target=/Users/mohamedriyad/Documents/JavaScript/mediasoup-demo/server/node_modules/mediasoup/worker/out/pip pip setuptools || \
npm ERR! 		python3.9 -m pip install --target=/Users/mohamedriyad/Documents/JavaScript/mediasoup-demo/server/node_modules/mediasoup/worker/out/pip pip setuptools || \
npm ERR! 		echo "Installation failed, likely because PIP is unavailable, if you are on Debian/Ubuntu or derivative please install the python3-pip package"
npm ERR! Collecting pip
npm ERR!   Using cached pip-22.1.2-py3-none-any.whl (2.1 MB)
npm ERR! Collecting setuptools
npm ERR!   Using cached setuptools-62.6.0-py3-none-any.whl (1.2 MB)
npm ERR! Installing collected packages: setuptools, pip
npm ERR! Successfully installed pip-22.1.2 setuptools-62.6.0
npm ERR! # Install `meson` and `ninja` using `pip` into custom location, so we don't
npm ERR! # depend on system-wide installation.
npm ERR! python3.9 -m pip install --upgrade --target=/Users/mohamedriyad/Documents/JavaScript/mediasoup-demo/server/node_modules/mediasoup/worker/out/pip  meson ninja
npm ERR! Collecting meson
npm ERR!   Using cached meson-0.62.2-py3-none-any.whl (864 kB)
npm ERR! Collecting ninja
npm ERR!   Using cached ninja-1.10.2.3-py2.py3-none-macosx_10_9_universal2.macosx_10_9_x86_64.macosx_11_0_arm64.macosx_11_0_universal2.whl (231 kB)
npm ERR! Installing collected packages: ninja, meson
npm ERR! Successfully installed meson-0.62.2 ninja-1.10.2.3
npm ERR! /Users/mohamedriyad/Documents/JavaScript/mediasoup-demo/server/node_modules/mediasoup/worker/out/pip/bin/meson setup \
npm ERR! 		--prefix /Users/mohamedriyad/Documents/JavaScript/mediasoup-demo/server/node_modules/mediasoup/worker/out/Release \
npm ERR! 		--bindir '' \
npm ERR! 		--libdir '' \
npm ERR! 		--buildtype release \
npm ERR! 		-Db_ndebug=true \
npm ERR! 		-Db_pie=true \
npm ERR! 		-Db_staticpic=true \
npm ERR! 		--reconfigure \
npm ERR! 		"" \
npm ERR! 		/Users/mohamedriyad/Documents/JavaScript/mediasoup-demo/server/node_modules/mediasoup/worker/out/Release/build || \
npm ERR! 		/Users/mohamedriyad/Documents/JavaScript/mediasoup-demo/server/node_modules/mediasoup/worker/out/pip/bin/meson setup \
npm ERR! 			--prefix /Users/mohamedriyad/Documents/JavaScript/mediasoup-demo/server/node_modules/mediasoup/worker/out/Release \
npm ERR! 			--bindir '' \
npm ERR! 			--libdir '' \
npm ERR! 			--buildtype release \
npm ERR! 			-Db_ndebug=true \
npm ERR! 			-Db_pie=true \
npm ERR! 			-Db_staticpic=true \
npm ERR! 			"" \
npm ERR! 			/Users/mohamedriyad/Documents/JavaScript/mediasoup-demo/server/node_modules/mediasoup/worker/out/Release/build
npm ERR! The Meson build system
npm ERR! Version: 0.62.2
npm ERR! Source dir: /Users/mohamedriyad/Documents/JavaScript/mediasoup-demo/server/node_modules/mediasoup/worker
npm ERR! Build dir: /Users/mohamedriyad/Documents/JavaScript/mediasoup-demo/server/node_modules/mediasoup/worker/out/Release/build
npm ERR! Build type: native build
npm ERR! Project name: mediasoup-worker
npm ERR! Project version: undefined
npm ERR! C compiler for the host machine: cc (clang 13.0.0 "Apple clang version 13.0.0 (clang-1300.0.29.3)")
npm ERR! C linker for the host machine: cc ld64 711
npm ERR! C++ compiler for the host machine: c++ (clang 13.0.0 "Apple clang version 13.0.0 (clang-1300.0.29.3)")
npm ERR! C++ linker for the host machine: c++ ld64 711
npm ERR! Host machine cpu family: x86_64
npm ERR! Host machine cpu: x86_64
npm ERR! 
npm ERR! meson.build:29:3: ERROR: Tried to access unknown option 'ms_log_trace'.
npm ERR! 
npm ERR! A full log can be found at /Users/mohamedriyad/Documents/JavaScript/mediasoup-demo/server/node_modules/mediasoup/worker/out/Release/build/meson-logs/meson-log.txt
npm ERR! Usage:   
npm ERR!   /usr/local/opt/python@3.9/bin/python3.9 -m pip install [options] <requirement specifier> [package-index-options] ...
npm ERR!   /usr/local/opt/python@3.9/bin/python3.9 -m pip install [options] -r <requirements file> [package-index-options] ...
npm ERR!   /usr/local/opt/python@3.9/bin/python3.9 -m pip install [options] [-e] <vcs project url> ...
npm ERR!   /usr/local/opt/python@3.9/bin/python3.9 -m pip install [options] [-e] <local project path> ...
npm ERR!   /usr/local/opt/python@3.9/bin/python3.9 -m pip install [options] <archive url/path> ...
npm ERR! 
npm ERR! no such option: --system
npm ERR! WARNING: There was an error checking the latest version of pip.
npm ERR! Directory does not contain a valid build tree:
npm ERR! /Users/mohamedriyad/Documents/JavaScript/mediasoup-demo/server/node_modules/mediasoup/worker/out/Release/build
npm ERR! make: *** [setup] Error 1

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/mohamedriyad/.npm/_logs/2022-06-27T10_04_06_231Z-debug-0.log

And here’s the complete log: 2022-06-27T10_04_06_231Z-debug-0.log

Can you remove node_modules folder and do a fresh install?

This error is related to pip, pip is throwing this error, if you search online you will find more things about it.

You can also try to install mediasoup 3.8.4 instead of 3.9 to if it works

You can try this option as well, as mentioned in the attached answer.

Fixed in 3.10.2.

1 Like