【问题标题】:"Error: FFMPEG not found": Error with simple Discord Bot“错误:未找到 FFMPEG”:简单 Discord Bot 出错
【发布时间】:2018-07-16 18:16:51
【问题描述】:

我使用的是安装了 Node.js 和 npm 的 Windows(64 位)。 在我的项目文件中,我运行了以下命令:

npm init
npm install discord.js --save
npm install ffmpeg --save

现在我刚刚创建了一个基本机器人的代码here 是主要代码。 我在这里列出了重要的:

 if (message.content === '!play' && message.member.roles.has(message.guild.roles.find("name", config.role_name).id)) {
    if (!message.member.voiceChannel) return log("?");
       message.member.voiceChannel.join().then(function (connection){      
       });
 }

然后,在 Discord 中,我说以下内容:

 [1517932146]  Musik bot loaded
    (node:35760) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: FFMPEG not found

我已经测试了以下内容:

  • 重新安装一切
  • 其他要求名称 e.t.z.
  • 简化代码

如果你有任何想法,请告诉我。

解决方案

npm i ffmpeg-binaries@3.2.2-3

link

【问题讨论】:

  • 您可能希望正确粘贴您的代码,当您单击该链接时,它会将您发送到一个空的 hastebin。

标签: javascript node.js ffmpeg discord discord.js


【解决方案1】:

您需要实际安装 ffmpeg,NPM 上的 ffmpeg 模块只是为 ffmpeg 的命令行界面导出一个包装器 API。

您可以下载 ffmpeg 的二进制文件 from the website 或使用包管理器(如 Ubuntu 上的 apt、Mac 上的 brew 或 Windows 上的 choco),它通常负责将二进制文件放入存在的目录中在PATH

【讨论】:

    【解决方案2】:

    据我所知,您实际上从未安装过ffmpeg。除非您使用install the binaries.,否则使用ffmpeg 节点模块不会让您有任何收获

    您还可以使用aptbrew 或在您的情况下使用choco,这会使事情进展得更快。 Here is a guide on how to do it in windows.

    安装后,您将能够使用许多节点模块,例如opusscript 等等。

    【讨论】:

      猜你喜欢
      • 2019-11-22
      • 2017-11-05
      • 2018-01-28
      • 2019-08-12
      • 2022-11-28
      • 2019-07-06
      • 1970-01-01
      • 1970-01-01
      • 2021-04-30
      相关资源
      最近更新 更多