• mediasoup3.7.0 在windows的下载和编译


    前言

    由于windows上下载mediasoup总是会报奇奇怪怪的错误,故做此文记录

    下载mediasoup

    npm i mediasoup --ignore-scripts
    

    编译

    • 需要提前下载visual studio 2019
    • python3
     cd node_modules/mediasoup
     python ./worker/scripts/configure.py --format=msvs -R mediasoup-worker
    

    如果出错

    workerdepsgyppylibgypinput.py:1186: SyntaxWarning: "is" with a literal. Did you mean "=="?
      if the_dict_key is 'variables' and variable_name in the_dict:
    ['--format=msvs', '-R', 'mediasoup-worker', 'worker\mediasoup-worker.gyp', '-I', 'worker\common.gypi', '--depth=worker', '-Dhost_arch=x64', '-Dtarget_arch=x64', '-Dopenssl_fips=', '-Dmediasoup_asan=false', '-Dnode_byteorder=little']
    Traceback (most recent call last):
      File "./worker/scripts/configure.py", line 114, in <module>
        run_gyp(gyp_args)
      File "./worker/scripts/configure.py", line 52, in run_gyp
        rc = gyp.main(args)
      File "workerdepsgyppylibgyp\__init__.py", line 545, in main
        return gyp_main(args)
      File "workerdepsgyppylibgyp\__init__.py", line 518, in gyp_main
        [generator, flat_list, targets, data] = Load(
      File "workerdepsgyppylibgyp\__init__.py", line 105, in Load
        generator.CalculateVariables(default_variables, params)
      File "workerdepsgyppylibgypgeneratormsvs.py", line 1934, in CalculateVariables
        msvs_version = MSVSVersion.SelectVisualStudioVersion(
      File "workerdepsgyppylibgypMSVSVersion.py", line 498, in SelectVisualStudioVersion
        return _CreateVersion(msvs_version, override_path, sdk_based=True)
      File "workerdepsgyppylibgypMSVSVersion.py", line 377, in _CreateVersion
        return versions[str(name)]
    

    打开MSVSVersion.py,找到return versions[str(name)],改成return versions[str('2019')]

    vs2019打开node_modules/mediasoup/worker下的mediasoup-worker.sln

    菜单栏下面选择Release Win32
    图
    在点击生成->生成解决方案 , 等待

    查看worker是否生成out和Release文件

    参考

    Mediasoup unable to install in Windows

    无法找到 Visual Studio 2010 的生成工具(平台工具集 =“v100”) 
    使用visual studio  2017/2019 打开项目,点击菜单栏-项目-重定目标解决方案,然后会提示修改版本,然后只修改版本
    
  • 相关阅读:
    oracle 动态SQL
    Oracle 学习PL/SQL
    SQL优化原理
    JAVA环境配置
    Java接口
    Java数据类型、操作符、表达式
    C#-VS配置开发环境-摘
    Java版本
    网站构建
    Java 时间、字符串
  • 原文地址:https://www.cnblogs.com/freeatalk/p/15093558.html
Copyright © 2020-2023  润新知