Friday, May 10, 2024
 Popular · Latest · Hot · Upcoming
59
rated 0 times [  64] [ 5]  / answers: 1 / hits: 47904  / 6 Years ago, tue, february 6, 2018, 12:00:00

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.



Solution



npm i [email protected]


link


More From » node.js

 Answers
16

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.


To install on windows using choco. Please ensure you running cmd/windows powershell/ windows terminal as administrator or it will fail here ...


choco install ffmpeg


To install on linux


sudo apt install ffmpeg


[#55243] Saturday, February 3, 2018, 6 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
lucianod

Total Points: 667
Total Questions: 106
Total Answers: 92

Location: Jordan
Member since Thu, Aug 5, 2021
3 Years ago
;