python-3.x Windows上的Mediasoup安装失败

ryoqjall  于 2023-05-19  发布在  Python
关注(0)|答案(1)|浏览(245)

我正在尝试安装mediasoup版本3,以下是安装过程中发生的错误:

$ npm i mediasoup --save
some dependencies like ninja and meson are installed successful.
/f/allMy/Projects/Practice/WebRTC/Mediasoup/node_modules/mediasoup/worker/out/pip/bin/meson setup \    
npm ERR!                --prefix /f/allMy/Projects/Practice/WebRTC/Mediasoup/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!                --vsenv \
npm ERR!                /f/allMy/Projects/Practice/WebRTC/Mediasoup/node_modules/mediasoup/worker/out/Release/build || \
npm ERR!                /f/allMy/Projects/Practice/WebRTC/Mediasoup/node_modules/mediasoup/worker/out/pip/bin/meson setup \
npm ERR!                        --prefix /f/allMy/Projects/Practice/WebRTC/Mediasoup/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!                        --vsenv \
npm ERR!                        /f/allMy/Projects/Practice/WebRTC/Mediasoup/node_modules/mediasoup/worker/out/Release/build
npm ERR! The Meson build system
npm ERR! Version: 0.61.5
npm ERR! Source dir: F:\allMy\Projects\Practice\WebRTC\Mediasoup\node_modules\mediasoup\worker
npm ERR! Build dir: F:\allMy\Projects\Practice\WebRTC\Mediasoup\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!
npm ERR! meson.build:1:0: ERROR: Could not find C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe
npm ERR!
npm ERR! A full log can be found at F:\allMy\Projects\Practice\WebRTC\Mediasoup\node_modules\mediasoup\worker\out\Release\build\meson-logs\meson-log.txt
npm ERR! make: Leaving directory `/f/allMy/Projects/Practice/WebRTC/Mediasoup/node_modules/mediasoup/worker'    
npm ERR! Usage:   
npm ERR!   c:\Users\tonys\AppData\Local\Programs\Python\Python311\python3.exe -m pip install [options] <requirement specifier> [package-index-options] ...
npm ERR!   c:\Users\tonys\AppData\Local\Programs\Python\Python311\python3.exe -m pip install [options] -r <requirements file> [package-index-options] ...
npm ERR!   c:\Users\tonys\AppData\Local\Programs\Python\Python311\python3.exe -m pip install [options] [-e] <vcs project url> ...
npm ERR!   c:\Users\tonys\AppData\Local\Programs\Python\Python311\python3.exe -m pip install [options] [-e] <local project path> ...
npm ERR!   c:\Users\tonys\AppData\Local\Programs\Python\Python311\python3.exe -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! F:\allMy\Projects\Practice\WebRTC\Mediasoup\node_modules\mediasoup\worker\out\Release\build
npm ERR! make: *** [setup] Error 1
npm ERR! npm-scripts.js [ERROR] executeCmd() failed, exiting: Error: Command failed: make -C worker

我的版本:

Python3.11
VSCode1.77.3
节点Js16.13.1

我已经尝试过通过Yarn安装,但这并没有解决它。

dfty9e19

dfty9e191#

正如我们(我和OP)在评论中讨论的那样,根据我们在Windows上的工作,这是答案。问题是Microsoft Visual Studio C未安装或未正确安装。mediasoup的一个必需功能是msbuild,可能还有一些其他未识别的功能,这些功能包括在Microsoft Visual Studio C中。

修复步骤:

1.从https://visualstudio.microsoft.com/downloads/下载Visual Studio
1.安装,并确保您选中了C++开发选项,如果您进一步查看它安装的内容,您可以看到msbuild,并继续安装,包括它,以及默认情况下为您选中的其他基本工具。
1.然后,重新启动您的计算机。
1.然后再次转到项目文件夹并重试npm install mediasoup@3命令,现在应该可以工作了。

**注意:**此答案仅适用于Windows,我在安装了make的Debian机器上尝试了npm install mediasoup@3命令,它不需要我执行任何上述步骤即可工作。OP也注意到了同样的事情,他们在Linux上尝试了这一点,它只是在没有任何行话的情况下工作。

相关问题