“Error: FFMPEG not found”: Error with simple Discord Bot

戏子无情 提交于 2019-12-21 05:51:59

问题


I'm using Windows (64-bit) with Node.js and npm installed. In my project file, I have run the following commands:

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

Now i just created the code for a basic bot here is the main code. I list here the important:

 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){      
       });
 }

Then, in Discord, I say the following:

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

I have already tested the following:

  • reinstallation of everything
  • others of the require names e.t.z.
  • simplify the code

So if you have any ideas then let me know. Thank you


回答1:


You need to actually install ffmpeg, the ffmpeg module on NPM simply exports a wrapper API for ffmpeg's command-line interface.

You can download ffmpeg's binaries from the website or use a package manager (like apt on Ubuntu, brew on Mac or choco on Windows) which usually takes care of dropping the binaries into a directory that is present in the PATH.




回答2:


As far as I can see, you never actually installed ffmpeg. Using the ffmpeg node module won't get you anywhere unless you install the binaries.

You can also use apt, brew or in your case choco which makes things go alot faster. Here is a guide on how to do it in windows.

Once it is installed you will be able to use many node modules such as opusscript and much more.



来源:https://stackoverflow.com/questions/48647177/error-ffmpeg-not-found-error-with-simple-discord-bot

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!