C:UsersAdmin>npm install discord.js ffmpeg-binaries opusscript ytdl-core —save
npm WARN deprecated ffmpeg-binaries@4.0.0: ffmpeg-binaries is no longer being maintained. use ffmpeg-static, or just install ffmpeg
> lzma-native@3.0.8 install C:UsersAdminnode_moduleslzma-native
> node-pre-gyp install —fallback-to-build && node node_modules/rimraf/bin.js build
[lzma-native] Success: «C:UsersAdminnode_moduleslzma-nativebinding-v3.0.8-node-v57-win32-x64lzma_native.node» is installed via remote
> ffmpeg-binaries@4.0.0 install C:UsersAdminnode_modulesffmpeg-binaries
> node install
events.js:183
throw er; // Unhandled ‘error’ event
^
Error: getaddrinfo ENOTFOUND ffmpeg.zeranoe.com ffmpeg.zeranoe.com:443
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:67:26)
npm WARN Admin No description
npm WARN Admin No repository field.
npm WARN Admin No license field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ffmpeg-binaries@4.0.0 install: `node install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ffmpeg-binaries@4.0.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:UsersAdminAppDataRoamingnpm-cache_logs2021-06-12T19_22_15_276Z-debug.log
Печатаю бота через Notepad++
Мне хотя бы его в cmd запустить, а я и директорию установить не могу((9(…
I am in the process of creating a Discord bot with JS, giving it management, auto role, etc. I just got to the music section of it and I can’t quite figure out whats wrong.
I believe I have installed FFmpeg correctly, as I have access to it from within the terminal. I have also used npm to bring ytdl-core and opusscript into my program.
What this should do is make the bot join the chat, then play the Youtube link. Currently, I am not error checking the second argument as I just wanted to get it working initially. I have implemented several different instances of .toString() and String() however it always gives the same error listed below.
. The program still throws this error:
TypeError [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received type object
TypeError [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received type object
C:UsersThresio's PCDesktopDiscord Botnode_modulesopusscriptbuildopusscript_native_wasm.js:8
var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var
key;for(key in Module){if(Module.hasOwnProperty(key))
{moduleOverrides[key]=Module[key]}}Module["arguments"]=
[];Module["thisProgram"]="./this.program";Module["quit"]=function(status,toThrow) {throw
toThrow};Module["preRun"]=[];Module["postRun"]=[];var ENVIRONMENT_IS_WEB=false;var
ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_HAS_NODE=false;var
ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof
importScripts==="function";ENVIRONMENT_HAS_NODE=typeof process==="object"&&typeof
process.versions==="object"&&typeof
process.versions.node==="string";ENVIRONMENT_IS_NODE=ENVIRONMENT_HAS_NODE&&!ENVIRONMENT_IS_WEB&&!ENVIRONM
ENT_IS_WORKER;ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var
scriptDirectory="";function locateFile(path){i
abort(TypeError [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type
string. Received type object). Build with -s ASSERTIONS=1 for more info.
Here is my code for calling play:
case 'play':
function play(connection, message){
var server = servers[message.guild.id];
server.dispatcher = connection.playStream(ytdl(server.queue[0], {filter: 'audioonly'}));
server.queue.shift();
server.dispatcher.on('end', function(){
if(server.queue[0]){
play(connection, message);
}else {
connection.disconnect();
}
})
}
if(!args[1]){
message.channel.send('You need to provide a link!');
return;
}
if(!message.member.voiceChannel){
message.channel.send('You must be in a voice channel to play music!');
return;
}
if(!servers[message.guild.id]) servers[message.guild.id] = {
queue: []
}
var server = servers[message.guild.id];
server.queue.push(args[1]);
if(!message.guild.voiceConnection) message.member.voiceChannel.join().then(function(connection){
play(connection, message);
})
break;
If anyone could assist with this, I would be very grateful.
EDIT: I unfortunately never figured out my main issue, but I have now found code that works (unlike mine :/).
For anyone else having this issue, I suggest using the code found here.
Works like a charm!
Hey guys. So I am having some trouble trying to create a personal discord bot because when I run the cmd prompt and do «npm install discord.js» I get some errors.
+— UNMET PEER DEPENDENCY node-opus@^0.2.1
`— UNMET PEER DEPENDENCY opusscript@^0.0.1
npm WARN discord.js@10.0.1 requires a peer of node-opus@^0.2.1 but none was installed.
npm WARN discord.js@10.0.1 requires a peer of opusscript@^0.0.1 but none was installed.
npm WARN diana@1.0.0 No repository field.
I’ve tried googling this and looking at articles but nothing seems to do anything. I did «npm init» and «npm i —save discord.js —no-optional» but it didn’t do anything and I couldn’t run it. Halp!
In order to run this, you’ll need to have ytdl-core
installed.
npm install --save ytdl-core
If you get an error that says ‘OPUS_ENGINE_MISSING’, you’ll need to install one of the opus packages discord.js recommends.
npm install --save node-opus
If you get an error that says ‘FFMPEG not found’, this can be resolved by installing ffmpeg.
On Debian / Ubuntu:
sudo apt-get install ffmpeg
On Windows:
npm install ffmpeg-binaries --save
Additionally, there have been reports that playing audio in this way from the Ubuntu subsystem offered by Windows 10 does not work.
Disable ur antivirus it might be blocking node event tracer
— Disable installation of all components as shown in image below
installation file image
— complete installation
— After installation again go to setup and enable components one by one and install , leave out performance counter
— After all components are installed code to cmd and do node -v u will see it works
Solution 2:
A batch script (within //nodejs/node_modules/npm) is no longer supported on Windows 10, version 1803. To add intents to your client, you can import
from discord.js and then add it to the client by using:
To learn more about intents, you can go to => Gateway Intents
«Error: FFMPEG not found»: Error with simple Discord Bot
Question:
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 ffmpeg-binaries@3.2.2-3
link
Solution 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
.
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
Solution 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.
«Error: FFMPEG not found»: Error with simple Discord Bot, 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 …
Fix Discord Hook64.dll Error when launching modern
Fix
Discord
Hook64.
dll
Error when launching modern warfare —
Discord
on Windows 10 — 20210:00 DiscordHook64.
dll
Error when launching modern warfare
How To Fix Dll Missing Problem
In this video i was shown you how to fix any types of
dll missing
problem on your windows computer without any software. if you will get any types of error r
How to Fix All .DLL file Missing Error in Windows PC
Fix all
missing dll
files in windows 10/8.1/7Click here for more detail http://www.bsocialshine.com/2016/06/how-to-fix-all-
dll
-file-
missing
…
Node.js install fails on Windows 10 1803
Question:
I finished my PC today and I wanted to install node.js on it.
But for some weird reason, it is saying «Copying files» and then after a few seconds, it says «Rolling back». I can’t think of a reason why it is not installing. Windows is Windows 10 «Spring Update» 1803.
Here’s a proof, in form of a unlisted video on Youtube.
Thanks in advance.
Niklas
Solution 1:
I was facing same problems in win 10 system but i was able to install it by doing following steps:
— Disable ur antivirus it might be blocking node event tracer
— Disable installation of all components as shown in image below
installation file image
— complete installation
— After installation again go to setup and enable components one by one and install , leave out performance counter
— After all components are installed code to cmd and do node -v u will see it works
Solution 2:
A batch script (within //nodejs/node_modules/npm) is no longer supported on Windows 10, version 1803. This file does not properly copy over
(this is NOT a hard drive issue but rather an issue with this version of Windows 10!)
.
File(s) affected:
-
nodejsnode_modulesnpmmake.bat
(This file
alone
requires a reboot.)
Copying this file over from the Zip archive IS possible, but requires a reboot to get out of the copy prompt.
Solution 3:
Same problem here, but after some research of old same problem, found to
install without ETW (Event tracing) or without Performance Counters
(during the installation you can select those options under Node.js runtime branch), but I got some new errors when npm install/npm run dev, some with node-sass issues.
EDIT:
Ok, so my problem was directly with my antivirus (Avast), I’ve been reading that with AVG there is the same problem, then you can install it without getting rid of ETW or PC.
Solution 4:
I had the same problem (On windows 10 1909). You can work around this by installing Node.js using Chocolatey instead https://chocolatey.org/packages/nodejs.install
Open Powershell elevated and run the following command:
choco install nodejs.install
That worked for me when everything else did not!
Note that
choco
is a Chocolatey command (it is like
npm
). If you don’t already have Chocolatey already installed, go to https://chocolatey.org/install and get the install command.
Discord.js missing access permision what should do?, Find centralized, trusted content and collaborate around the technologies you use most. Learn more
When I start my discord bot I get an error on the console
Question:
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module 'discord.js-player/src/lib/classes/queue/ytdl-core'
Require stack:
- D:programDiscord botindex.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (D:programDiscord botindex.js:12:15)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [ 'D:\program\Discord bot\index.js' ]
}
The discord.js I installed. I looked around the internet but couldn’t find one that would solve the problem. I tried to reinstall Node.js but it won’t come back. Please help! Thank You!
Solution:
Requiring dependency of another package
From the error, I am assuming that you are attempting to require the
ytdl-core
package. However, you’re currently trying to require it from the package
discord.js-player
. This will not work because
ytdl-core
is loaded separately from
discord.js-player
as a dependency. If you need the package separately, you should install it with
npm i ytdl-core
and require it with something like this:
// index.js
const ytdl = require("ytdl-core");
Node.js — Discord bot not answering messages, i’ve been trying a new project which is to code a discord bot with discord.js in node. The source code for interactions in the discord.js …
ReferenceError: Client Missing Intents Discord Bot [duplicate]
Question:
I’ve just started working on a discord bot, but whenever I try to start it using node . in the cmd prompt, I get this error;
C:UserskauteOneDriveÁrea de TrabalhoProjetos De ProgramaçãoNewBotnode_modulesdiscord.jssrcclientClient.js:548
throw new TypeError('CLIENT_MISSING_INTENTS');
^
TypeError [CLIENT_MISSING_INTENTS]: Valid intents must be provided for the Client.
at Client._validateOptions (C:UserskauteOneDriveÁrea de TrabalhoProjetos De ProgramaçãoNewBotnode_modulesdiscord.jssrcclientClient.js:548:13)
at new Client (C:UserskauteOneDriveÁrea de TrabalhoProjetos De ProgramaçãoNewBotnode_modulesdiscord.jssrcclientClient.js:76:10)
at Object.<anonymous> (C:UserskauteOneDriveÁrea de TrabalhoProjetos De ProgramaçãoNewBotsrcmain.js:2:13)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47 {
[Symbol(code)]: 'CLIENT_MISSING_INTENTS'
}
Waiting for the debugger to disconnect...
I’ve looked around and cant find anything specific enough to fix my issue. Here is my code;
const Discord = require('discord.js');
const bot = new Discord.Client();
const token = The Token;
bot.on('ready', () => {
console.log('The bot is ready!')
});
As I said I just started today, so There isn’t much here
Solution:
Since discord.js v13, you need to provide intents when declaring the intents. They were introduced so that developers could choose which events their bot needed to recieve based on which data it needs to function. To add intents to your client, you can import
Intents
from discord.js and then add it to the client by using:
const { Intents, Client } = require('discord.js')
const client = new Client({
intents: [
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_MESSAGES
]
})
To learn more about intents, you can go to => Gateway Intents
Discord Bot Doesn’t reply back, I’ven struggling creating a bot for my discord server so i used the initial code for the discord bot from discordjs.guide and added a simple …