Install mediasoup on device with apple m1 cpu (Error: unknown target cpu))

Hi, I have a MacBook Air with m1 cpu. I try to install mediasoup with npm install but it fails with Error: unknown target cpu 'armv8-a+crypto'

I have installed xcode.
This is the versions of requirements:

Hadis-MacBook-Air@ ~/Documents/newFolder % gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 13.0.0 (clang-1300.0.29.3)
Target: arm64-apple-darwin21.1.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
Hadis-MacBook-Air@ ~/Documents/newFolder % cc --version
Apple clang version 13.0.0 (clang-1300.0.29.3)
Target: arm64-apple-darwin21.1.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
Hadis-MacBook-Air@ ~/Documents/newFolder % python --version
Python 2.7.18
Hadis-MacBook-Air@ ~/Documents/newFolder % python3 --version
Python 3.9.7

Full output of npm install mediasoup:

npm ERR! code 1
npm ERR! path /Users/hadiaghandeh/Documents/projects/sapio-rtc-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 -m pip install --system --target=/Users/hadiaghandeh/Documents/projects/sapio-rtc-server/node_modules/mediasoup/worker/out/pip pip setuptools || \
npm ERR!                python3 -m pip install --target=/Users/hadiaghandeh/Documents/projects/sapio-rtc-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-21.3.1-py3-none-any.whl (1.7 MB)
npm ERR! Collecting setuptools
npm ERR!   Using cached setuptools-58.5.3-py3-none-any.whl (946 kB)
npm ERR! Installing collected packages: setuptools, pip
npm ERR! Successfully installed pip-21.3.1 setuptools-58.5.3
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 -m pip install --upgrade --target=/Users/hadiaghandeh/Documents/projects/sapio-rtc-server/node_modules/mediasoup/worker/out/pip  meson ninja
npm ERR! Collecting meson
npm ERR!   Using cached meson-0.60.1-py3-none-any.whl (837 kB)
npm ERR! Collecting ninja
npm ERR!   Using cached ninja-1.10.2.2-py2.py3-none-macosx_10_9_universal2.macosx_10_9_x86_64.macosx_11_0_arm64.macosx_11_0_universal2.whl (225 kB)
npm ERR! Installing collected packages: ninja, meson
npm ERR! Successfully installed meson-0.60.1 ninja-1.10.2.2
npm ERR! /Users/hadiaghandeh/Documents/projects/sapio-rtc-server/node_modules/mediasoup/worker/out/pip/bin/meson setup \
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/hadiaghandeh/Documents/projects/sapio-rtc-server/node_modules/mediasoup/worker/out/Release || \
npm ERR!                /Users/hadiaghandeh/Documents/projects/sapio-rtc-server/node_modules/mediasoup/worker/out/pip/bin/meson setup \
npm ERR!                        --buildtype release \
npm ERR!                        -Db_ndebug=true \
npm ERR!                        -Db_pie=true \
npm ERR!                        -Db_staticpic=true \
npm ERR!                        "" \
npm ERR!                        /Users/hadiaghandeh/Documents/projects/sapio-rtc-server/node_modules/mediasoup/worker/out/Release
npm ERR! The Meson build system
npm ERR! Version: 0.60.1
npm ERR! Source dir: /Users/hadiaghandeh/Documents/projects/sapio-rtc-server/node_modules/mediasoup/worker
npm ERR! Build dir: /Users/hadiaghandeh/Documents/projects/sapio-rtc-server/node_modules/mediasoup/worker/out/Release
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: aarch64
npm ERR! Host machine cpu: arm64
npm ERR! Downloading openssl source from https://www.openssl.org/source/openssl-1.1.1l.tar.gz
npm ERR! Download size: 9834044
npm ERR! Downloading: ..........
npm ERR! Downloading openssl patch from https://wrapdb.mesonbuild.com/v2/openssl_1.1.1l-2/get_patch
npm ERR! Download size: 10613607
npm ERR! Downloading: ..........
npm ERR! 
npm ERR! Executing subproject openssl 
npm ERR! 
npm ERR! openssl| Project name: openssl
npm ERR! openssl| Project version: 1.1.1l
npm ERR! openssl| C compiler for the host machine: cc (clang 13.0.0 "Apple clang version 13.0.0 (clang-1300.0.29.3)")
npm ERR! openssl| C linker for the host machine: cc ld64 711
npm ERR! openssl| Run-time dependency threads found: YES
npm ERR! openssl| Program as found: YES 13.0.0 (/usr/bin/as)
npm ERR! openssl| Message: OpenSSL is configured with ASM support
npm ERR! openssl| Build targets in project: 3
npm ERR! openssl| Subproject openssl finished.
npm ERR! 
npm ERR! Downloading nlohmann_json source from https://github.com/nlohmann/json/releases/download/v3.9.1/include.zip
npm ERR! Download size: 309315
npm ERR! Downloading: ..........
npm ERR! Downloading nlohmann_json patch from https://wrapdb.mesonbuild.com/v2/nlohmann_json_3.9.1-1/get_patch
npm ERR! Download size: 792
npm ERR! Downloading: ..........
npm ERR! 
npm ERR! Executing subproject nlohmann_json 
npm ERR! 
npm ERR! nlohmann_json| Project name: nlohmann_json
npm ERR! nlohmann_json| Project version: 3.9.1
npm ERR! nlohmann_json| C++ compiler for the host machine: c++ (clang 13.0.0 "Apple clang version 13.0.0 (clang-1300.0.29.3)")
npm ERR! nlohmann_json| C++ linker for the host machine: c++ ld64 711
npm ERR! nlohmann_json| Build targets in project: 3
npm ERR! nlohmann_json| Subproject nlohmann_json finished.
npm ERR! 
npm ERR! Downloading libuv source from https://dist.libuv.org/dist/v1.42.0/libuv-v1.42.0.tar.gz
npm ERR! Download size: 1284534
npm ERR! Downloading: ..........
npm ERR! Downloading libuv patch from https://wrapdb.mesonbuild.com/v2/libuv_1.42.0-1/get_patch
npm ERR! Download size: 5146
npm ERR! Downloading: ..........
npm ERR! 
npm ERR! Executing subproject libuv 
npm ERR! 
npm ERR! libuv| Project name: libuv
npm ERR! libuv| Project version: 1.42.0
npm ERR! libuv| C compiler for the host machine: cc (clang 13.0.0 "Apple clang version 13.0.0 (clang-1300.0.29.3)")
npm ERR! libuv| C linker for the host machine: cc ld64 711
npm ERR! libuv| Fetching value of define "__QNX__" :
npm ERR! libuv| Fetching value of define "_AIX" :
npm ERR! libuv| Message: System: darwin
npm ERR! libuv| Compiler for C supports arguments -fno-strict-aliasing: YES
npm ERR! libuv| Dependency threads found: YES unknown (cached)
npm ERR! libuv| Build targets in project: 4
npm ERR! libuv| Subproject libuv finished.
npm ERR! 
npm ERR! Downloading libsrtp2 source from https://github.com/cisco/libsrtp/archive/refs/tags/v2.4.2.zip
npm ERR! Download size: 1286149
npm ERR! Downloading: ..........
npm ERR! 
npm ERR! Executing subproject libsrtp2 
npm ERR! 
npm ERR! libsrtp2| Project name: libsrtp2
npm ERR! libsrtp2| Project version: 2.4.2
npm ERR! libsrtp2| C compiler for the host machine: cc (clang 13.0.0 "Apple clang version 13.0.0 (clang-1300.0.29.3)")
npm ERR! libsrtp2| C linker for the host machine: cc ld64 711
npm ERR! libsrtp2| Has header "arpa/inet.h" : YES
npm ERR! libsrtp2| Has header "byteswap.h" : NO
npm ERR! libsrtp2| Has header "inttypes.h" : YES
npm ERR! libsrtp2| Has header "machine/types.h" : YES
npm ERR! libsrtp2| Has header "netinet/in.h" : YES
npm ERR! libsrtp2| Has header "stdint.h" : YES
npm ERR! libsrtp2| Has header "stdlib.h" : YES
npm ERR! libsrtp2| Has header "sys/int_types.h" : NO
npm ERR! libsrtp2| Has header "sys/socket.h" : YES
npm ERR! libsrtp2| Has header "sys/types.h" : YES
npm ERR! libsrtp2| Has header "sys/uio.h" : YES
npm ERR! libsrtp2| Has header "unistd.h" : YES
npm ERR! libsrtp2| Checking for function "sigaction" : YES
npm ERR! libsrtp2| Checking for function "inet_aton" : YES
npm ERR! libsrtp2| Checking for function "usleep" : YES
npm ERR! libsrtp2| Checking for function "socket" : YES
npm ERR! libsrtp2| Has header "stdint.h" : YES (cached)
npm ERR! libsrtp2| Checking for type "size_t" : YES
npm ERR! libsrtp2| Checking for type "unsigned long" : YES
npm ERR! libsrtp2| Checking for size of "unsigned long" : 8
npm ERR! libsrtp2| Checking for type "unsigned long long" : YES
npm ERR! libsrtp2| Checking for size of "unsigned long long" : 8
npm ERR! libsrtp2| Checking if "inline keyword check" : compiles: YES
npm ERR! libsrtp2| Dependency openssl from subproject subprojects/openssl-1.1.1l found: YES 1.1.1l
npm ERR! libsrtp2| Configuring config.h using configuration
npm ERR! libsrtp2| Compiler for C supports arguments -Wstrict-prototypes: YES
npm ERR! libsrtp2| Compiler for C supports arguments -funroll-loops: YES
npm ERR! libsrtp2| Program doxygen found: NO
npm ERR! libsrtp2| Build targets in project: 5
npm ERR! libsrtp2| Subproject libsrtp2 finished.
npm ERR! 
npm ERR! Downloading usrsctp source from https://github.com/sctplab/usrsctp/archive/9d6b99b10a70f7a63d21cd80d03c353da9ac19d3.zip
npm ERR! Download size: 949227
npm ERR! Downloading: ..........
npm ERR! 
npm ERR! Executing subproject usrsctp 
npm ERR! 
npm ERR! usrsctp| Project name: usrsctplib
npm ERR! usrsctp| Project version: 0.9.5.0
npm ERR! usrsctp| C compiler for the host machine: cc (clang 13.0.0 "Apple clang version 13.0.0 (clang-1300.0.29.3)")
npm ERR! usrsctp| C linker for the host machine: cc ld64 711
npm ERR! usrsctp| Compiler for C supports arguments -pedantic: YES
npm ERR! usrsctp| Compiler for C supports arguments -Wfloat-equal: YES
npm ERR! usrsctp| Compiler for C supports arguments -Wshadow: YES
npm ERR! usrsctp| Compiler for C supports arguments -Wpointer-arith: YES
npm ERR! usrsctp| Compiler for C supports arguments -Winit-self: YES
npm ERR! usrsctp| Compiler for C supports arguments -Wno-unused-function: YES
npm ERR! usrsctp| Compiler for C supports arguments -Wno-unused-parameter: YES
npm ERR! usrsctp| Compiler for C supports arguments -Wno-unreachable-code: YES
npm ERR! usrsctp| Compiler for C supports arguments -Wstrict-prototypes: YES (cached)
npm ERR! usrsctp| Dependency threads found: YES unknown (cached)
npm ERR! usrsctp| Compiler for C supports arguments -Wno-address-of-packed-member: YES
npm ERR! usrsctp| Compiler for C supports arguments -Wno-deprecated-declarations: YES
npm ERR! usrsctp| Has header "sys/queue.h" : YES
npm ERR! usrsctp| Has header "sys/socket.h" : YES (cached)
npm ERR! usrsctp| Has header "linux/if_addr.h" : NO
npm ERR! usrsctp| Has header "linux/rtnetlink.h" : NO
npm ERR! usrsctp| Has header "sys/types.h" : YES (cached)
npm ERR! usrsctp| Has header "netinet/in.h" : YES (cached)
npm ERR! usrsctp| Has header "netinet/ip.h" : YES
npm ERR! usrsctp| Has header "netinet/ip_icmp.h" : YES
npm ERR! usrsctp| Has header "net/route.h" : YES
npm ERR! usrsctp| Has header "stdatomic.h" : YES
npm ERR! usrsctp| Checking whether type "struct sockaddr" has member "sa_len" : YES
npm ERR! usrsctp| Checking whether type "struct sockaddr_in" has member "sin_len" : YES
npm ERR! usrsctp| Checking whether type "struct sockaddr_in6" has member "sin6_len" : YES
npm ERR! usrsctp| Checking whether type "struct sockaddr_conn" has member "sconn_len" : YES
npm ERR! usrsctp| Build targets in project: 6
npm ERR! usrsctp| Subproject usrsctp finished.
npm ERR! 
npm ERR! Downloading abseil-cpp source from https://github.com/abseil/abseil-cpp/archive/20210324.2.tar.gz
npm ERR! Downloading file of unknown size.
npm ERR! Downloading abseil-cpp patch from https://wrapdb.mesonbuild.com/v2/abseil-cpp_20210324.2-2/get_patch
npm ERR! Download size: 3296
npm ERR! Downloading: ..........
npm ERR! 
npm ERR! Executing subproject abseil-cpp 
npm ERR! 
npm ERR! abseil-cpp| Project name: abseil-cpp
npm ERR! abseil-cpp| Project version: 20210324.1
npm ERR! abseil-cpp| C++ compiler for the host machine: c++ (clang 13.0.0 "Apple clang version 13.0.0 (clang-1300.0.29.3)")
npm ERR! abseil-cpp| C++ linker for the host machine: c++ ld64 711
npm ERR! abseil-cpp| Checking for size of "void*" : 8
npm ERR! abseil-cpp| Compiler for C++ supports arguments -Wno-sign-compare: YES
npm ERR! abseil-cpp| Compiler for C++ supports arguments -march=armv8-a+crypto: YES
npm ERR! abseil-cpp| Checking if "GCC atomic builtins" : links: YES
npm ERR! abseil-cpp| Dependency threads found: YES unknown (cached)
npm ERR! abseil-cpp| Found pkg-config: /opt/homebrew/bin/pkg-config (0.29.2)
npm ERR! abseil-cpp| Run-time dependency corefoundation found: YES (/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework)
npm ERR! abseil-cpp| Build targets in project: 18
npm ERR! abseil-cpp| Subproject abseil-cpp finished.
npm ERR! 
npm ERR! Downloading catch2 source from https://github.com/catchorg/Catch2/archive/v2.13.7.zip
npm ERR! Downloading file of unknown size.
npm ERR! Downloading catch2 patch from https://wrapdb.mesonbuild.com/v2/catch2_2.13.7-1/get_patch
npm ERR! Download size: 1133
npm ERR! Downloading: ..........
npm ERR! 
npm ERR! Executing subproject catch2 
npm ERR! 
npm ERR! catch2| Project name: catch2
npm ERR! catch2| Project version: 2.13.7
npm ERR! catch2| C++ compiler for the host machine: c++ (clang 13.0.0 "Apple clang version 13.0.0 (clang-1300.0.29.3)")
npm ERR! catch2| C++ linker for the host machine: c++ ld64 711
npm ERR! catch2| Build targets in project: 18
npm ERR! catch2| Subproject catch2 finished.
npm ERR! 
npm ERR! WARNING: Project targeting '>= 0.58' but tried to use feature deprecated since '0.56.0': meson.source_root. use meson.project_source_root() or meson.global_source_root() instead.
npm ERR! Build targets in project: 22
npm ERR! WARNING: Deprecated features used:
npm ERR!  * 0.56.0: {'meson.source_root'}
npm ERR! 
npm ERR! mediasoup-worker undefined
npm ERR! 
npm ERR!   Subprojects
npm ERR!     abseil-cpp   : YES
npm ERR!     catch2       : YES
npm ERR!     libsrtp2     : YES
npm ERR!     libuv        : YES
npm ERR!     nlohmann_json: YES
npm ERR!     openssl      : YES
npm ERR!     usrsctp      : YES
npm ERR! 
npm ERR!   User defined options
npm ERR!     buildtype    : release
npm ERR!     b_ndebug     : true
npm ERR!     b_pie        : true
npm ERR!     b_staticpic  : true
npm ERR! 
npm ERR! Found ninja-1.10.2.git.kitware.jobserver-1 at /Users/hadiaghandeh/Documents/projects/sapio-rtc-server/node_modules/mediasoup/worker/out/pip/bin/ninja
npm ERR! /Users/hadiaghandeh/Documents/projects/sapio-rtc-server/node_modules/mediasoup/worker/out/pip/bin/meson compile -j 8 -C /Users/hadiaghandeh/Documents/projects/sapio-rtc-server/node_modules/mediasoup/worker/out/Release mediasoup-worker
npm ERR! ninja: Entering directory `/Users/hadiaghandeh/Documents/projects/sapio-rtc-server/node_modules/mediasoup/worker/out/Release'
npm ERR! [1/979] Compiling C++ object mediasoup-worker.p/src_DepLibWebRTC.cpp.o
npm ERR! [2/979] Compiling C++ object mediasoup-worker.p/src_DepOpenSSL.cpp.o
npm ERR! [3/979] Compiling C++ object mediasoup-worker.p/src_Logger.cpp.o
npm ERR! [4/979] Compiling C++ object mediasoup-worker.p/src_DepLibUV.cpp.o
npm ERR! [5/979] Compiling C++ object mediasoup-worker.p/src_DepLibSRTP.cpp.o
npm ERR! [6/979] Compiling C++ object mediasoup-worker.p/src_DepUsrSCTP.cpp.o
npm ERR! [7/979] Compiling C++ object mediasoup-worker.p/src_lib.cpp.o
npm ERR! [8/979] Compiling C++ object mediasoup-worker.p/src_Utils_Crypto.cpp.o
npm ERR! [9/979] Compiling C++ object mediasoup-worker.p/src_MediaSoupErrors.cpp.o
npm ERR! [10/979] Compiling C++ object mediasoup-worker.p/src_Utils_File.cpp.o
npm ERR! [11/979] Compiling C++ object mediasoup-worker.p/src_RTC_RtpListener.cpp.o
npm ERR! [12/979] Compiling C++ object mediasoup-worker.p/src_Utils_IP.cpp.o
npm ERR! [13/979] Compiling C++ object mediasoup-worker.p/src_handles_SignalsHandler.cpp.o
npm ERR! [14/979] Compiling C++ object mediasoup-worker.p/src_Utils_String.cpp.o
npm ERR! [15/979] Compiling C++ object mediasoup-worker.p/src_Settings.cpp.o
npm ERR! [16/979] Compiling C++ object mediasoup-worker.p/src_handles_TcpConnectionHandler.cpp.o
npm ERR! [17/979] Compiling C++ object mediasoup-worker.p/src_handles_Timer.cpp.o
npm ERR! [18/979] Compiling C++ object mediasoup-worker.p/src_handles_TcpServerHandler.cpp.o
npm ERR! [19/979] Compiling C++ object mediasoup-worker.p/src_handles_UdpSocketHandler.cpp.o
npm ERR! [20/979] Compiling C++ object mediasoup-worker.p/src_Worker.cpp.o
npm ERR! [21/979] Compiling C++ object mediasoup-worker.p/src_handles_UnixStreamSocket.cpp.o
npm ERR! [22/979] Compiling C++ object mediasoup-worker.p/src_Channel_ChannelNotifier.cpp.o
npm ERR! [23/979] Compiling C++ object mediasoup-worker.p/src_PayloadChannel_PayloadChannelNotifier.cpp.o
npm ERR! [24/979] Compiling C++ object mediasoup-worker.p/src_PayloadChannel_Notification.cpp.o
npm ERR! [25/979] Compiling C++ object mediasoup-worker.p/src_Channel_ChannelRequest.cpp.o
npm ERR! [26/979] Compiling C++ object mediasoup-worker.p/src_PayloadChannel_PayloadChannelRequest.cpp.o
npm ERR! [27/979] Compiling C++ object mediasoup-worker.p/src_Channel_ChannelSocket.cpp.o
npm ERR! [28/979] Compiling C++ object mediasoup-worker.p/src_RTC_ActiveSpeakerObserver.cpp.o
npm ERR! [29/979] Compiling C++ object mediasoup-worker.p/src_PayloadChannel_PayloadChannelSocket.cpp.o
npm ERR! [30/979] Compiling C++ object mediasoup-worker.p/src_RTC_AudioLevelObserver.cpp.o
npm ERR! [31/979] Compiling C++ object mediasoup-worker.p/src_RTC_DataProducer.cpp.o
npm ERR! [32/979] Compiling C++ object mediasoup-worker.p/src_RTC_DataConsumer.cpp.o
npm ERR! [33/979] Compiling C++ object mediasoup-worker.p/src_RTC_IceServer.cpp.o
npm ERR! [34/979] Compiling C++ object mediasoup-worker.p/src_RTC_IceCandidate.cpp.o
npm ERR! [35/979] Compiling C++ object mediasoup-worker.p/src_RTC_DtlsTransport.cpp.o
npm ERR! [36/979] Compiling C++ object mediasoup-worker.p/src_RTC_Consumer.cpp.o
npm ERR! [37/979] Compiling C++ object mediasoup-worker.p/src_RTC_DirectTransport.cpp.o
npm ERR! [38/979] Compiling C++ object mediasoup-worker.p/src_RTC_KeyFrameRequestManager.cpp.o
npm ERR! [39/979] Compiling C++ object mediasoup-worker.p/src_RTC_NackGenerator.cpp.o
npm ERR! [40/979] Compiling C++ object mediasoup-worker.p/src_RTC_RateCalculator.cpp.o
npm ERR! [41/979] Compiling C++ object mediasoup-worker.p/src_RTC_RtpObserver.cpp.o
npm ERR! [42/979] Compiling C++ object mediasoup-worker.p/src_RTC_PortManager.cpp.o
npm ERR! [43/979] Compiling C++ object mediasoup-worker.p/src_RTC_PipeConsumer.cpp.o
npm ERR! [44/979] Compiling C++ object mediasoup-worker.p/src_RTC_PipeTransport.cpp.o
npm ERR! [45/979] Compiling C++ object mediasoup-worker.p/src_RTC_PlainTransport.cpp.o
npm ERR! [46/979] Compiling C++ object mediasoup-worker.p/src_RTC_RtpProbationGenerator.cpp.o
npm ERR! [47/979] Compiling C++ object mediasoup-worker.p/src_RTC_RtpPacket.cpp.o
npm ERR! [48/979] Compiling C++ object mediasoup-worker.p/src_RTC_Producer.cpp.o
npm ERR! [49/979] Compiling C++ object mediasoup-worker.p/src_RTC_RtpStream.cpp.o
npm ERR! [50/979] Compiling C++ object mediasoup-worker.p/src_RTC_RtpStreamSend.cpp.o
npm ERR! [51/979] Compiling C++ object mediasoup-worker.p/src_RTC_RtpStreamRecv.cpp.o
npm ERR! [52/979] Compiling C++ object mediasoup-worker.p/src_RTC_RtxStream.cpp.o
npm ERR! [53/979] Compiling C++ object mediasoup-worker.p/src_RTC_SctpAssociation.cpp.o
npm ERR! [54/979] Compiling C++ object mediasoup-worker.p/src_RTC_SenderBandwidthEstimator.cpp.o
npm ERR! [55/979] Compiling C++ object mediasoup-worker.p/src_RTC_SctpListener.cpp.o
npm ERR! [56/979] Compiling C++ object mediasoup-worker.p/src_RTC_Router.cpp.o
npm ERR! [57/979] Compiling C++ object mediasoup-worker.p/src_RTC_SeqManager.cpp.o
npm ERR! [58/979] Compiling C++ object mediasoup-worker.p/src_RTC_SrtpSession.cpp.o
npm ERR! [59/979] Compiling C++ object mediasoup-worker.p/src_RTC_StunPacket.cpp.o
npm ERR! [60/979] Compiling C++ object mediasoup-worker.p/src_RTC_TcpConnection.cpp.o
npm ERR! [61/979] Compiling C++ object mediasoup-worker.p/src_RTC_TcpServer.cpp.o
npm ERR! [62/979] Compiling C++ object mediasoup-worker.p/src_RTC_SimpleConsumer.cpp.o
npm ERR! [63/979] Compiling C++ object mediasoup-worker.p/src_RTC_TransportCongestionControlClient.cpp.o
npm ERR! [64/979] Compiling C++ object mediasoup-worker.p/src_RTC_SimulcastConsumer.cpp.o
npm ERR! [65/979] Compiling C++ object mediasoup-worker.p/src_RTC_SvcConsumer.cpp.o
npm ERR! [66/979] Compiling C++ object mediasoup-worker.p/src_RTC_UdpSocket.cpp.o
npm ERR! [67/979] Compiling C++ object mediasoup-worker.p/src_RTC_TrendCalculator.cpp.o
npm ERR! [68/979] Compiling C++ object mediasoup-worker.p/src_RTC_TransportCongestionControlServer.cpp.o
npm ERR! [69/979] Compiling C++ object mediasoup-worker.p/src_RTC_TransportTuple.cpp.o
npm ERR! [70/979] Compiling C++ object mediasoup-worker.p/src_RTC_Codecs_H264.cpp.o
npm ERR! [71/979] Compiling C++ object mediasoup-worker.p/src_RTC_Codecs_VP8.cpp.o
npm ERR! [72/979] Compiling C++ object mediasoup-worker.p/src_RTC_Codecs_VP9.cpp.o
npm ERR! [73/979] Compiling C++ object mediasoup-worker.p/src_RTC_RtpDictionaries_Media.cpp.o
npm ERR! [74/979] Compiling C++ object mediasoup-worker.p/src_RTC_RtpDictionaries_RtcpFeedback.cpp.o
npm ERR! [75/979] Compiling C++ object mediasoup-worker.p/src_RTC_RtpDictionaries_Parameters.cpp.o
npm ERR! [76/979] Compiling C++ object mediasoup-worker.p/src_RTC_RtpDictionaries_RtcpParameters.cpp.o
npm ERR! [77/979] Compiling C++ object mediasoup-worker.p/src_RTC_RtpDictionaries_RtpCodecMimeType.cpp.o
npm ERR! [78/979] Compiling C++ object mediasoup-worker.p/src_RTC_RtpDictionaries_RtpCodecParameters.cpp.o
npm ERR! [79/979] Compiling C++ object mediasoup-worker.p/src_RTC_RtpDictionaries_RtpHeaderExtensionParameters.cpp.o
npm ERR! [80/979] Compiling C++ object mediasoup-worker.p/src_RTC_Transport.cpp.o
npm ERR! [81/979] Compiling C++ object mediasoup-worker.p/src_RTC_RtpDictionaries_RtpHeaderExtensionUri.cpp.o
npm ERR! [82/979] Compiling C++ object mediasoup-worker.p/src_RTC_WebRtcTransport.cpp.o
npm ERR! [83/979] Compiling C++ object mediasoup-worker.p/src_RTC_RTCP_SenderReport.cpp.o
npm ERR! [84/979] Compiling C++ object mediasoup-worker.p/src_RTC_SctpDictionaries_SctpStreamParameters.cpp.o
npm ERR! [85/979] Compiling C++ object mediasoup-worker.p/src_RTC_RtpDictionaries_RtpRtxParameters.cpp.o
npm ERR! [86/979] Compiling C++ object mediasoup-worker.p/src_RTC_RTCP_Packet.cpp.o
npm ERR! [87/979] Compiling C++ object mediasoup-worker.p/src_RTC_RTCP_CompoundPacket.cpp.o
npm ERR! [88/979] Compiling C++ object mediasoup-worker.p/src_RTC_RTCP_ReceiverReport.cpp.o
npm ERR! [89/979] Compiling C++ object mediasoup-worker.p/src_RTC_RtpDictionaries_RtpEncodingParameters.cpp.o
npm ERR! [90/979] Compiling C++ object mediasoup-worker.p/src_RTC_RtpDictionaries_RtpParameters.cpp.o
npm ERR! [91/979] Compiling C++ object mediasoup-worker.p/src_RTC_RTCP_Bye.cpp.o
npm ERR! [92/979] Compiling C++ object mediasoup-worker.p/src_RTC_RTCP_FeedbackRtpNack.cpp.o
npm ERR! [93/979] Compiling C++ object mediasoup-worker.p/src_RTC_RTCP_Sdes.cpp.o
npm ERR! [94/979] Compiling C++ object mediasoup-worker.p/src_RTC_RTCP_Feedback.cpp.o
npm ERR! [95/979] Compiling C++ object mediasoup-worker.p/src_RTC_RTCP_FeedbackRtp.cpp.o
npm ERR! [96/979] Compiling C++ object mediasoup-worker.p/src_RTC_RTCP_FeedbackRtpTmmb.cpp.o
npm ERR! [97/979] Compiling C++ object mediasoup-worker.p/src_RTC_RTCP_FeedbackPs.cpp.o
npm ERR! [98/979] Compiling C++ object mediasoup-worker.p/src_RTC_RTCP_FeedbackRtpSrReq.cpp.o
npm ERR! [99/979] Compiling C++ object mediasoup-worker.p/src_RTC_RTCP_FeedbackRtpTllei.cpp.o
npm ERR! [100/979] Compiling C++ object mediasoup-worker.p/src_RTC_RTCP_FeedbackRtpEcn.cpp.o
npm ERR! [101/979] Compiling C++ object mediasoup-worker.p/src_RTC_RTCP_FeedbackPsPli.cpp.o
npm ERR! [102/979] Compiling C++ object mediasoup-worker.p/src_RTC_RTCP_FeedbackPsSli.cpp.o
npm ERR! [103/979] Compiling C++ object mediasoup-worker.p/src_RTC_RTCP_FeedbackPsFir.cpp.o
npm ERR! [104/979] Compiling C++ object mediasoup-worker.p/src_RTC_RTCP_FeedbackPsRpsi.cpp.o
npm ERR! [105/979] Compiling C++ object mediasoup-worker.p/src_RTC_RTCP_FeedbackPsTst.cpp.o
npm ERR! [106/979] Compiling C++ object mediasoup-worker.p/src_RTC_RTCP_FeedbackPsVbcm.cpp.o
npm ERR! [107/979] Compiling C++ object mediasoup-worker.p/src_RTC_RTCP_FeedbackPsLei.cpp.o
npm ERR! [108/979] Compiling C++ object subprojects/abseil-cpp-20210324.2/libabsl_types.a.p/absl_types_bad_variant_access.cc.o
npm ERR! FAILED: subprojects/abseil-cpp-20210324.2/libabsl_types.a.p/absl_types_bad_variant_access.cc.o 
npm ERR! c++ -Isubprojects/abseil-cpp-20210324.2/libabsl_types.a.p -Isubprojects/abseil-cpp-20210324.2 -I../../subprojects/abseil-cpp-20210324.2 -fcolor-diagnostics -DNDEBUG -std=c++11 -O3 -Wno-sign-compare -march=armv8-a+crypto -MD -MQ subprojects/abseil-cpp-20210324.2/libabsl_types.a.p/absl_types_bad_variant_access.cc.o -MF subprojects/abseil-cpp-20210324.2/libabsl_types.a.p/absl_types_bad_variant_access.cc.o.d -o subprojects/abseil-cpp-20210324.2/libabsl_types.a.p/absl_types_bad_variant_access.cc.o -c ../../subprojects/abseil-cpp-20210324.2/absl/types/bad_variant_access.cc
npm ERR! error: unknown target CPU 'armv8-a+crypto'
npm ERR! note: valid target CPU values are: nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge, core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512, skx, cascadelake, cooperlake, cannonlake, icelake-client, icelake-server, tigerlake, sapphirerapids, alderlake, knl, knm, k8, athlon64, athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10, barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2, znver3, x86-64, x86-64-v2, x86-64-v3, x86-64-v4
npm ERR! [109/979] Compiling C++ object mediasoup-worker.p/src_RTC_RTCP_FeedbackRtpTransport.cpp.o
npm ERR! [110/979] Compiling C++ object mediasoup-worker.p/src_RTC_RTCP_FeedbackPsAfb.cpp.o
npm ERR! [111/979] Compiling C++ object mediasoup-worker.p/src_RTC_RTCP_FeedbackPsRemb.cpp.o
npm ERR! [112/979] Compiling C++ object mediasoup-worker.p/src_RTC_RTCP_XrDelaySinceLastRr.cpp.o
npm ERR! [113/979] Compiling C++ object mediasoup-worker.p/src_RTC_RTCP_XR.cpp.o
npm ERR! [114/979] Compiling C++ object mediasoup-worker.p/src_RTC_RTCP_XrReceiverReferenceTime.cpp.o
npm ERR! [115/979] Compiling C++ object mediasoup-worker.p/src_main.cpp.o
npm ERR! ninja: build stopped: subcommand failed.
npm ERR! Usage:   
npm ERR!   /opt/homebrew/opt/python@3.9/bin/python3.9 -m pip install [options] <requirement specifier> [package-index-options] ...
npm ERR!   /opt/homebrew/opt/python@3.9/bin/python3.9 -m pip install [options] -r <requirements file> [package-index-options] ...
npm ERR!   /opt/homebrew/opt/python@3.9/bin/python3.9 -m pip install [options] [-e] <vcs project url> ...
npm ERR!   /opt/homebrew/opt/python@3.9/bin/python3.9 -m pip install [options] [-e] <local project path> ...
npm ERR!   /opt/homebrew/opt/python@3.9/bin/python3.9 -m pip install [options] <archive url/path> ...
npm ERR! 
npm ERR! no such option: --system
npm ERR! Directory does not contain a valid build tree:
npm ERR! /Users/hadiaghandeh/Documents/projects/sapio-rtc-server/node_modules/mediasoup/worker/out/Release
npm ERR! make: *** [mediasoup-worker] Error 1

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/hadiaghandeh/.npm/_logs/2021-11-07T07_22_07_850Z-debug.log

Just install ARM compiler instead of x86-64 compiler and it will “just work”. There have been similar questions both on the forum and issues in the repo.

1 Like

I am not very familiar with compilers. How can I confirm that my compiler is x86_64? (I searched and I couldn’t really find anything, I don’t know the relative keyword).

my clang -v output:
Does it mean my compiler is x86-64?

Apple clang version 13.0.0 (clang-1300.0.29.3)
Target: arm64-apple-darwin21.1.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Please check the latest topics in the forum. It’s there.

1 Like

I just found out the problem actually occurs when I am using mediasoup 3.9.0. However, it compiles successfully with mediasoup 3.8.4.
As far as I see, I am using arm compiler Target: arm64-apple-darwin21.1.0. So the issue might be related to mediasoup 3.9.0.

1 Like

3.9.0 uses different build system. It detects that you have Aarch64 machine and tries to optimize crypto for it, but your compiler says it can’t do AArch64, only AMD64 :man_shrugging:

There must be something you need to tweak or reinstall, but I have no idea what because I don’t even own Mac machine at the moment.

1 Like

Perhaps the build system you mentioned detects arm64 a different architecture from aarch64. I may need to change the toolchain. I investigate more if I can fix my problem.

thanks for the awesome information.

thanks my issue has been fixed.