DEV Community

Cover image for How to set up a Discord music bot (Updated December 2021)

How to set up a Discord music bot (Updated December 2021)

Nir on September 13, 2019

Setting up a music bot isn't easy since it requires lots of different things to be installed. In this guide I will list all the requirements and pr...
Collapse
 
leonida18351756 profile image
Leonidas

Can you help me?

(node:9104) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see nodejs.org/api/cli.html#cli_unhand...). (rejection id: 1)
(node:9104) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Thats the error i get. Tried some trouble shooting, but didnt work. Also i dont hear any sound when my bot joins the channel... Is both the same problem or whats happening here? Pls help me, thanks.

Collapse
 
saibhargavsankoji profile image
Sai Bhargav Sankoji

Hey i have the same error. Could you please help me

Collapse
 
galnir profile image
Nir

Check again if you installed everything listed here, if something is missing it's not gonna work

Collapse
 
leonida18351756 profile image
Leonidas

Yes. I did everything like you said on top of this Blog. I followed every single step.

Collapse
 
madmouseked profile image
Madmouseked

Hey, I tried a few things and I can't get the thing to run npm install properly.
gyp ERR! find VS
gyp ERR! find VS msvs_version not set from command line or npm config
gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer
gyp ERR! find VS looking for Visual Studio 2015
gyp ERR! find VS - not found
gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
gyp ERR! find VS
gyp ERR! find VS **************************************************************
gyp ERR! find VS You need to install the latest version of Visual Studio
gyp ERR! find VS including the "Desktop development with C++" workload.
gyp ERR! find VS For more information consult the documentation at:
gyp ERR! find VS github.com/nodejs/node-gyp#on-windows
gyp ERR! find VS **************************************************************
gyp ERR! find VS
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Visual Studio installation to use
gyp ERR! stack at VisualStudioFinder.fail (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:16
gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:351:14)
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:70:14
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:372:16
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
gyp ERR! stack at ChildProcess.exithandler (child_process.js:302:5)
gyp ERR! stack at ChildProcess.emit (events.js:210:5)
gyp ERR! stack at maybeClose (internal/child_process.js:1021:16)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\MadmouseKed\Desktop\Erika-Bot\Master-Bot\node_modules\node-opus
gyp ERR! node -v v12.13.1
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
npm WARN discord.js-commando@0.11.0-dev requires a peer of @types/better-sqlite3@5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js-commando@0.11.0-dev requires a peer of better-sqlite3@5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js-commando@0.11.0-dev requires a peer of discord.js@12.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js-commando@0.11.0-dev requires a peer of sqlite@3.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN master-bot@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ref@1.3.5 (node_modules\ref):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ref@1.3.5 install: node-gyp rebuild
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-opus@0.3.2 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-opus@0.3.2 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:\Users\MadmouseKed\AppData\Roaming\npm-cache_logs\2019-12-03T15_45_58_318Z-debug.log

Hope you can help me out,
Thanks!
-Ked

Collapse
 
galnir profile image
Nir

According to stackoverflow it might be due to c++ build tools not being installed.
Take a look at this stackoverflow.com/questions/575414...

Collapse
 
dungcan profile image
DungCan

internal/modules/cjs/loader.js:800
throw err;
^

Error: Cannot find module 'C:\Users\Truong Anh\Desktop\bot\index.js'
?[90m at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797
:15)?[39m
?[90m at Function.Module._load (internal/modules/cjs/loader.js:690:27)?[39m
?[90m at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)?[39
m
?[90m at internal/main/run_main_module.js:17:11?[39m {
code: ?[32m'MODULE_NOT_FOUND'?[39m,
requireStack: []
}

this is my trouble errors . help me please !!

Collapse
 
galnir profile image
Nir

Have you installed everything I listed?

Collapse
 
dungcan profile image
DungCan • Edited

yes . i installed all thing in this post . but i use python 3.7.0 :/

Thread Thread
 
galnir profile image
Nir

Install 2.7 then

Collapse
 
thekidwunder profile image
WunderKid • Edited

Error: Could not find an Opus module! Please install node-opus or opusscript.
at new OpusStream (C:\Users\WunderKid\Desktop\Master-Bot\node_modules\prism-media\src\opus\Opus.js:41:13)
at new Decoder (C:\Users\WunderKid\Desktop\Master-Bot\node_modules\prism-media\src\opus\Opus.js:163:1)
at AudioPlayer.playOpusStream (C:\Users\WunderKid\Desktop\Master-Bot\node_modules\discord.js\src\client\voice\player\BasePlayer.js:79:23)
at VoiceConnection.play (C:\Users\WunderKid\Desktop\Master-Bot\node_modules\discord.js\src\client\voice\util\PlayInterface.js:74:28)
at VoiceConnection.onSessionDescription (C:\Users\WunderKid\Desktop\Master-Bot\node_modules\discord.js\src\client\voice\VoiceConnection.js:455:29)
at VoiceWebSocket.emit (events.js:198:13)
at VoiceWebSocket.onPacket (C:\Users\WunderKid\Desktop\Master-Bot\node_modules\discord.js\src\client\voice\networking\VoiceWebSocket.js:188:14)
at VoiceWebSocket.onMessage (C:\Users\WunderKid\Desktop\Master-Bot\node_modules\discord.js\src\client\voice\networking\VoiceWebSocket.js:139:19)
at WebSocket.onMessage (C:\Users\WunderKid\Desktop\Master-Bot\node_modules\ws\lib\event-target.js:120:16)
at WebSocket.emit (events.js:198:13)

Collapse
 
galnir profile image
Nir

Did you install node-opus?

npm install node-opus

Collapse
 
happyman001144 profile image
Happyman001144

I get an error when I try to install node opus. Can you suggest what I should do?

node-opus@0.3.3 install C:\Users\georg\Downloads\Master-Bot\node_modules\node-opus

node-gyp rebuild

C:\Users\georg\Downloads\Master-Bot\node_modules\node-opus>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\Users\georg\AppData\Local\Programs\Python\Python38-32\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack File "", line 1
gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack at ChildProcess.exithandler (child_process.js:294:12)
gyp ERR! stack at ChildProcess.emit (events.js:189:13)
gyp ERR! stack at maybeClose (internal/child_process.js:970:16)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\georg\Downloads\Master-Bot\node_modules\node-opus
gyp ERR! node -v v10.15.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN discord.js@12.0.0-dev requires a peer of @discordjs/uws@11.149.1 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@12.0.0-dev requires a peer of bufferutil@4.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@12.0.0-dev requires a peer of erlpack@discordapp/erlpack but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@12.0.0-dev requires a peer of libsodium-wrappers@0.7.4 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@12.0.0-dev requires a peer of sodium@3.0.2 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@12.0.0-dev requires a peer of zlib-sync@0.1.4 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@12.0.0-dev requires a peer of zucc@0.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js-commando@0.11.0-dev requires a peer of @types/better-sqlite3@5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js-commando@0.11.0-dev requires a peer of better-sqlite3@5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js-commando@0.11.0-dev requires a peer of discord.js@12.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js-commando@0.11.0-dev requires a peer of sqlite@3.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN prism-media@1.1.0 requires a peer of opusscript@0.0.6 but none is installed. You must install peer dependencies yourself.
npm WARN master-bot@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-opus@0.3.3 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-opus@0.3.3 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:\Users\georg\AppData\Roaming\npm-cache_logs\2019-10-30T20_20_37_834Z-debug.log

Thread Thread
 
galnir profile image
Nir

You are using python version 3.x and it requires python version 2.7

Collapse
 
damixadkatakara profile image
damixadkatakara • Edited

hi i have a error

  • c:\Users\imady\OneDrive\Desktop\bot-final.edition\index.js at Function.Module._resolveFilename (internal/modules/cjs/loader.js:793:17) at Function.Module._load (internal/modules/cjs/loader.js:686:27) at Module.require (internal/modules/cjs/loader.js:848:19) at require (internal/modules/cjs/helpers.js:74:18) at Object. (c:\Users\imady\OneDrive\Desktop\bot-final.edition\index.js:1:28) at Module._compile (internal/modules/cjs/loader.js:952:14) at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10) at Module.load (internal/modules/cjs/loader.js:811:32) at Function.Module._load (internal/modules/cjs/loader.js:723:14) at Function.Module.runMain (internal/modules/cjs/loader.js:1043:10)

end i have a error whit NPM code
extract: WARN tar ENOENT: no such file or directory, open 'C:\Users\imady\OneDrive\Desktop\bot-final.edition\node_modules.staging\@babel\types-

Collapse
 
galnir profile image
Nir

Did you install all the dependencies and other requirements?

Collapse
 
damixadkatakara profile image
damixadkatakara

ok i managed to settle my problem with friend but a new problem is before us
debugger listening on ws://127.0.0.1:4777/7ce98a6d-7418-49f0-acae-6553fff29399
For help, see: nodejs.org/en/docs/inspector

Debugger attached.
WaitingError: Cannot find module '../../config.json'
Require stack:

  • c:\Users\imady\OneDrive\Desktop\bot-final.edition\commands\gifs\animegif.js
  • c:\Users\imady\OneDrive\Desktop\bot-final.edition\node_modules\require-all\index.js
  • c:\Users\imady\OneDrive\Desktop\bot-final.edition\node_modules\discord.js-commando\src\registry.js
  • c:\Users\imady\OneDrive\Desktop\bot-final.edition\node_modules\discord.js-commando\src\client.js
  • c:\Users\imady\OneDrive\Desktop\bot-final.edition\node_modules\discord.js-commando\src\index.js
  • c:\Users\imady\OneDrive\Desktop\bot-final.edition\index.js at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15) at Function.Module._load (internal/modules/cjs/loader.js:862:27) at Module.require (internal/modules/cjs/loader.js:1040:19) at require (internal/modules/cjs/helpers.js:72:18) at Object. (c:\Users\imady\OneDrive\Desktop\bot-final.edition\commands\gifs\animegif.js:2:22) at Module._compile (internal/modules/cjs/loader.js:1151:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1171:10) at Module.load (internal/modules/cjs/loader.js:1000:32) at Function.Module._load (internal/modules/cjs/loader.js:899:14) at Module.require (internal/modules/cjs/loader.js:1040:19) for the debugger to disconnect...
Thread Thread
 
damixadkatakara profile image
damixadkatakara

debugger listening on ws://127.0.0.1:33350/4b02f0da-9828-4ed9-a1cd-5ba111b9b611
For help, see: nodejs.org/en/docs/inspector
Debugger attached.
Waiting foError: Cannot find module '../../config.json'
Require stack:

  • c:\Users\imady\OneDrive\Desktop\bot-final.edition\commands\gifs\animegif.js
  • c:\Users\imady\OneDrive\Desktop\bot-final.edition\node_modules\require-all\index.js
  • c:\Users\imady\OneDrive\Desktop\bot-final.edition\node_modules\discord.js-commando\src\registry.js
  • c:\Users\imady\OneDrive\Desktop\bot-final.edition\node_modules\discord.js-commando\src\client.js
  • c:\Users\imady\OneDrive\Desktop\bot-final.edition\node_modules\discord.js-commando\src\index.js
  • c:\Users\imady\OneDrive\Desktop\bot-final.edition\index.js at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15) at Function.Module._load (internal/modules/cjs/loader.js:862:27) at Module.require (internal/modules/cjs/loader.js:1040:19) at require (internal/modules/cjs/helpers.js:72:18) at Object. (c:\Users\imady\OneDrive\Desktop\bot-final.edition\commands\gifs\animegif.js:2:22) at Module._compile (internal/modules/cjs/loader.js:1151:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1171:10) at Module.load (internal/modules/cjs/loader.js:1000:32) at Function.Module._load (internal/modules/cjs/loader.js:899:14) at Module.require (internal/modules/cjs/loader.js:1040:19) r the debugger to disconnect...

is its this is the new error code

Collapse
 
pagonasp3 profile image
PagOnASp

throw err;
^

Error: Cannot find module 'C:\Users\pagonasp\Desktop\New folder (2)'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
at Function.Module._load (internal/modules/cjs/loader.js:841:27)
at Function.executeUserEntryPoint as runMain
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}

Collapse
 
joshuaih03 profile image
joshua.ihns

Can you help me?

throw err;
^

SyntaxError: C:\Master-Bot-master\config.json: Unexpected token / in JSON at position 24
at parse ()
at Object.Module._extensions..json (internal/modules/cjs/loader.js:1192:22)
at Module.load (internal/modules/cjs/loader.js:1002:32)
at Function.Module._load (internal/modules/cjs/loader.js:901:14)
at Module.require (internal/modules/cjs/loader.js:1044:19)
at require (internal/modules/cjs/helpers.js:77:18)
at Object. (C:\Master-Bot-master\index.js:4:27)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
at Module.load (internal/modules/cjs/loader.js:1002:32)

don't know how to fix this... :(

Collapse
 
galnir profile image
Nir

You didn't place an api key correctly in config.json

Collapse
 
enigma profile image
Enigma • Edited

I have a problem when I run npm install in command prompt, it shows me this:

Collapse
 
enigma profile image
Enigma
Collapse
 
enigma profile image
Enigma

nvm, i fixed that but i have another problem

Collapse
 
grantttt profile image
grantttt

hey may i know how you fixed that?

Thread Thread
 
enigma profile image
Enigma

it's been 6 fucking months

Thread Thread
 
grantttt profile image
grantttt

lol i just saw this thread

Collapse
 
mostafa12a profile image
MOSTAFA12A

PS C:\Users\roke\Desktop\igdj> npm i node-opus
npm WARN deprecated node-opus@0.3.3: This project is unmaintained. See @discordjs/opus for an alternative.
npm ERR! code 1
npm ERR! path C:\Users\roke\Desktop\igdj\node_modules\node-opus
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@8.2.0
npm ERR! gyp info using node@16.9.1 | win32 | x64
npm ERR! gyp ERR! find Python
npm ERR! gyp ERR! find Python Python is not set from command line or npm configuration
npm ERR! gyp ERR! find Python Python is not set from environment variable PYTHON
npm ERR! gyp ERR! find Python checking if "python3" can be used
npm ERR! gyp ERR! find Python - "python3" is not in PATH or produced an error
npm ERR! gyp ERR! find Python checking if "python" can be used
npm ERR! gyp ERR! find Python - "python" is not in PATH or produced an error
npm ERR! gyp ERR! find Python checking if Python is C:\Users\roke\AppData\Local\Programs\Python\Python39\python.exe
npm ERR! gyp ERR! find Python - "C:\Users\roke\AppData\Local\Programs\Python\Python39\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python39\python.exe
npm ERR! gyp ERR! find Python - "C:\Program Files\Python39\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Users\roke\AppData\Local\Programs\Python\Python39-32\python.exe
npm ERR! gyp ERR! find Python - "C:\Users\roke\AppData\Local\Programs\Python\Python39-32\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python39-32\python.exe
npm ERR! gyp ERR! find Python - "C:\Program Files\Python39-32\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python39-32\python.exe
npm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python39-32\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Users\roke\AppData\Local\Programs\Python\Python38\python.exe
npm ERR! gyp ERR! find Python - "C:\Users\roke\AppData\Local\Programs\Python\Python38\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python38\python.exe
npm ERR! gyp ERR! find Python - "C:\Program Files\Python38\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Users\roke\AppData\Local\Programs\Python\Python38-32\python.exe
npm ERR! gyp ERR! find Python - "C:\Users\roke\AppData\Local\Programs\Python\Python38-32\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python38-32\python.exe
npm ERR! gyp ERR! find Python - "C:\Program Files\Python38-32\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python38-32\python.exe
npm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python38-32\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Users\roke\AppData\Local\Programs\Python\Python37\python.exe
npm ERR! gyp ERR! find Python - "C:\Users\roke\AppData\Local\Programs\Python\Python37\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python37\python.exe
npm ERR! gyp ERR! find Python - "C:\Program Files\Python37\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Users\roke\AppData\Local\Programs\Python\Python37-32\python.exe
npm ERR! gyp ERR! find Python - "C:\Users\roke\AppData\Local\Programs\Python\Python37-32\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python37-32\python.exe
npm ERR! gyp ERR! find Python - "C:\Program Files\Python37-32\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python37-32\python.exe
npm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python37-32\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Users\roke\AppData\Local\Programs\Python\Python36\python.exe
npm ERR! gyp ERR! find Python - "C:\Users\roke\AppData\Local\Programs\Python\Python36\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python36\python.exe
npm ERR! gyp ERR! find Python - "C:\Program Files\Python36\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Users\roke\AppData\Local\Programs\Python\Python36-32\python.exe
npm ERR! gyp ERR! find Python - "C:\Users\roke\AppData\Local\Programs\Python\Python36-32\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python36-32\python.exe
npm ERR! gyp ERR! find Python - "C:\Program Files\Python36-32\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python36-32\python.exe
npm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python36-32\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if the py launcher can be used to find Python 3
npm ERR! gyp ERR! find Python - "py.exe" is not in PATH or produced an error
npm ERR! gyp ERR! find Python
npm ERR! gyp ERR! find Python **********************************************************
npm ERR! gyp ERR! find Python You need to install the latest version of Python.
npm ERR! gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
npm ERR! gyp ERR! find Python you can try one of the following options:
npm ERR! gyp ERR! find Python - Use the switch --python="C:\Path\To\python.exe"
npm ERR! gyp ERR! find Python (accepted by both node-gyp and npm)
npm ERR! gyp ERR! find Python - Set the environment variable PYTHON
npm ERR! gyp ERR! find Python - Set the npm configuration variable python:
npm ERR! gyp ERR! find Python npm config set python "C:\Path\To\python.exe"
npm ERR! gyp ERR! find Python For more information consult the documentation at:
npm ERR! gyp ERR! find Python github.com/nodejs/node-gyp#install...
npm ERR! gyp ERR! find Python **********************************************************
npm ERR! gyp ERR! find Python
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Could not find any Python installation to use
npm ERR! gyp ERR! stack at PythonFinder.fail (C:\Users\roke\Desktop\igdj\node_modules\node-gyp\lib\find-python.js:330:47)
npm ERR! gyp ERR! stack at PythonFinder.runChecks (C:\Users\roke\Desktop\igdj\node_modules\node-gyp\lib\find-python.js:159:21)
npm ERR! gyp ERR! stack at PythonFinder. (C:\Users\roke\Desktop\igdj\node_modules\node-gyp\lib\find-python.js:228:18)
npm ERR! gyp ERR! stack at PythonFinder.execFileCallback (C:\Users\roke\Desktop\igdj\node_modules\node-gyp\lib\find-python.js:294:16)
npm ERR! gyp ERR! stack at ChildProcess.exithandler (node:child_process:404:5)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:394:28)
npm ERR! gyp ERR! stack at maybeClose (node:internal/child_process:1064:16)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
npm ERR! gyp ERR! System Windows_NT 10.0.19041
npm ERR! gyp ERR! command "C:\Users\roke\Desktop\igdj\node_modules\node\bin\node.exe" "C:\Users\roke\Desktop\igdj\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd C:\Users\roke\Desktop\igdj\node_modules\node-opus
npm ERR! gyp ERR! node -v v16.9.1
npm ERR! gyp ERR! node-gyp -v v8.2.0
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\roke\AppData\Local\npm-cache_logs\2021-09-26T13_47_14_392Z-debug.log

Collapse
 
nvptvjp profile image
NVPTVJP

help me plz beg u
Error: Cannot find module 'timers/promises'
Require stack:

  • C:\Users\kgev\node_modules\@discordjs\rest\dist\lib\handlers\SequentialHandler.js
  • C:\Users\kgev\node_modules\@discordjs\rest\dist\lib\RequestManager.js
  • C:\Users\kgev\node_modules\@discordjs\rest\dist\index.js
  • C:\Users\kgev\index.js ←[90m at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)←[39m ←[90m at Function.Module._load (internal/modules/cjs/loader.js:745:27)←[39m ←[90m at Module.require (internal/modules/cjs/loader.js:961:19)←[39m ←[90m at require (internal/modules/cjs/helpers.js:92:18)←[39m at Object. (C:\Users\kgev\node_modules\←[4m@discordjs←[24m\rest\dist\lib\handlers\SequentialHandler.js:6:20) ←[90m at Module._compile (internal/modules/cjs/loader.js:1072:14)←[39m ←[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)←[39m ←[90m at Module.load (internal/modules/cjs/loader.js:937:32)←[39m ←[90m at Function.Module._load (internal/modules/cjs/loader.js:778:12)←[39m ←[90m at Module.require (internal/modules/cjs/loader.js:961:19)←[39m { code: ←[32m'MODULE_NOT_FOUND'←[39m, requireStack: [ ←[32m'C:\Users\kgev\node_modules\@discordjs\rest\dist\lib\handlers\SequentialHandler.js'←[39m, ←[32m'C:\Users\kgev\node_modules\@discordjs\rest\dist\lib\RequestManager.js'←[39m, ←[32m'C:\Users\kgev\node_modules\@discordjs\rest\dist\index.js'←[39m, ←[32m'C:\Users\kgev\index.js'←[39m ] }
Collapse
 
therealmaestro profile image
TheRealMaestro

Hey I need help, done all you said and getting an error when I try to do node index.js

throw err;
^

Error: Cannot find module 'timers/promises'
Require stack:

  • C:\Users\Oringe\Desktop\Master-Bot\node_modules\@discordjs\rest\dist\lib\handlers\SequentialHandler.js
  • C:\Users\Oringe\Desktop\Master-Bot\node_modules\@discordjs\rest\dist\lib\RequestManager.js
  • C:\Users\Oringe\Desktop\Master-Bot\node_modules\@discordjs\rest\dist\index.js
  • C:\Users\Oringe\Desktop\Master-Bot\index.js at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15) at Function.Module._load (internal/modules/cjs/loader.js:745:27) at Module.require (internal/modules/cjs/loader.js:961:19) at require (internal/modules/cjs/helpers.js:92:18) at Object. (C:\Users\Oringe\Desktop\Master-Bot\node_modules\@discordjs\rest\dist\lib\handlers\SequentialHandler.js:6:20) at Module._compile (internal/modules/cjs/loader.js:1072:14) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10) at Module.load (internal/modules/cjs/loader.js:937:32) at Function.Module._load (internal/modules/cjs/loader.js:778:12) at Module.require (internal/modules/cjs/loader.js:961:19) { code: 'MODULE_NOT_FOUND', requireStack: [ 'C:\Users\Oringe\Desktop\Master-Bot\node_modules\@discordjs\rest\dist\lib\handlers\SequentialHandler.js', 'C:\Users\Oringe\Desktop\Master-Bot\node_modules\@discordjs\rest\dist\lib\RequestManager.js', 'C:\Users\Oringe\Desktop\Master-Bot\node_modules\@discordjs\rest\dist\index.js', 'C:\Users\Oringe\Desktop\Master-Bot\index.js' ] }

Please and thank you

Collapse
 
dungcan profile image
DungCan

internal/modules/cjs/loader.js:305
throw err;
^

Error: Cannot find module 'C:\Users\Truong Anh\Desktop\bot1\index.js'. Please verify that the package.json has
a valid "main" entry
?[90m at tryPackage (internal/modules/cjs/loader.js:297:19)?[39m
?[90m at Function.Module._findPath (internal/modules/cjs/loader.js:528:18)?[39m
?[90m at Function.Module._resolveFilename (internal/modules/cjs/loader.js:784:27)?[39m
?[90m at Function.Module._load (internal/modules/cjs/loader.js:690:27)?[39m
?[90m at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)?[39m
?[90m at internal/main/run_main_module.js:17:11?[39m {
code: ?[32m'MODULE_NOT_FOUND'?[39m,
path: ?[32m'C:\Users\Truong Anh\Desktop\bot1\package.json'?[39m,
requestPath: ?[32m'C:\Users\Truong Anh\Desktop\bot1'?[39m
}

this is my trouble error
any suggestions to help me?

Collapse
 
justreallyquick profile image
sav

im struggling so much here, i cannot figure out what this error means or what im supposed to do to fix it... it just keeps saying "Error: Cannot Find Module" when i try to do node index.js it just keeps saying that.

Collapse
 
suprx44 profile image
SupRx44

Same. Big thanks to the author, eh... wow rolls eyes

Collapse
 
bennett_rivers_393fd162f6 profile image
Bennett Rivers

I keep getting this error when running a play command through discord

An error occurred while running the command: TypeError: Cannot read property 'length' of undefined
You shouldn't ever receive an error like this.
Please contact the bot owner.

I have ffmpeg, python, and git all installed, so I don't know what I did wrong.

Collapse
 
shamithoysal profile image
shamithoysal

Heyo! Absolutely LOVED the post. It worked perfectly. I just wanted to know if I could edit the help command? I would do that because as I build up on this bot, I can add to the help command. Thanks in advance!

Collapse
 
almobtadi07 profile image
almobtadi07

SyntaxError: /home/danielfa/Master-Bot/config.json: Unexpected token / in JSON a t position 21
at parse ()
at Object.Module._extensions..json (internal/modules/cjs/loader.js:1152:22)
at Module.load (internal/modules/cjs/loader.js:982:32)
at Function.Module._load (internal/modules/cjs/loader.js:875:14)
at Module.require (internal/modules/cjs/loader.js:1022:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object. (/home/danielfa/Master-Bot/index.js:4:27)
at Module._compile (internal/modules/cjs/loader.js:1118:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1138:10)
at Module.load (internal/modules/cjs/loader.js:982:32)

Collapse
 
kostasxp12 profile image
Kostasxp12

Can someone help me, I am trying to install npm but it just hangs.
Its not a network issue as it just gets stuck forever
this is the last thing it shows before getting stuck : extract:discord.js-commando: sill extract github:discordjs/Commando extracted to C:\Users\"Myuser"
\Desktop\Master-Bot\node_modules.staging\discord.js-commando-c5a3c176 (31760ms)

Collapse
 
shivamthakkar profile image
shivamthakkar

error

E:\Master-Bot-master>node index.js
internal/modules/cjs/loader.js:1184
throw err;
^

SyntaxError: E:\Master-Bot-master\config.json: Unexpected token / in JSON at pos
ition 21
at parse ()
←[90m at Object.Module._extensions..json (internal/modules/cjs/loader.js:1181
:22)←[39m
←[90m at Module.load (internal/modules/cjs/loader.js:996:32)←[39m
←[90m at Function.Module._load (internal/modules/cjs/loader.js:896:14)←[39m
←[90m at Module.require (internal/modules/cjs/loader.js:1036:19)←[39m
←[90m at require (internal/modules/cjs/helpers.js:72:18)←[39m
at Object. (E:\Master-Bot-master\index.js:4:27)
←[90m at Module._compile (internal/modules/cjs/loader.js:1147:30)←[39m
←[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:1
0)←[39m
←[90m at Module.load (internal/modules/cjs/loader.js:996:32)←[39m

Collapse
 
grantttt profile image
grantttt • Edited

Hi, I'm getting this error when trying npm install. Any idea how I can solve this?

C:\Users\grant\Desktop>npm install
npm WARN saveError ENOENT: no such file or directory, open 'C:\Users\grant\Desktop\package.json'
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\grant\Desktop\package.json'
npm WARN Desktop No description
npm WARN Desktop No repository field.
npm WARN Desktop No README data
npm WARN Desktop No license field.

the bot doesn't go online

Collapse
 
blythethea profile image
blythethea

Did you ever solve this, I am having the same errors

Collapse
 
jxancho2 profile image
Jxancho

Hi i have a problem, you can help me pls?

C:\Users\dayea\Desktop\Master-Bot>node index.js
internal/modules/cjs/loader.js:1274
throw err;
^

SyntaxError: C:\Users\dayea\Desktop\Master-Bot\config.json: Unexpected token / in JSON at position 23
at parse ()
[90m at Object.Module._extensions..json (internal/modules/cjs/loader.js:1271:22)[39m
[90m at Module.load (internal/modules/cjs/loader.js:1085:32)[39m
[90m at Function.Module._load (internal/modules/cjs/loader.js:950:14)[39m
[90m at Module.require (internal/modules/cjs/loader.js:1125:19)[39m
[90m at require (internal/modules/cjs/helpers.js:75:18)[39m
at Object. (C:\Users\dayea\Desktop\Master-Bot\index.js:4:45)
[90m at Module._compile (internal/modules/cjs/loader.js:1236:30)[39m
[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1257:10)[39m
[90m at Module.load (internal/modules/cjs/loader.js:1085:32)[39m

C:\Users\dayea\Desktop\Master-Bot>node index.js

Collapse
 
suvakas15 profile image
Suvakas

What should i do?

C:\Users\Enriko\Desktop\DiscordMusicBot\Master-Bot>node index.js
internal/modules/cjs/loader.js:985
throw err;
^

Error: Cannot find module 'discord.js-commando'
Require stack:

  • C:\Users\Enriko\Desktop\DiscordMusicBot\Master-Bot\index.js [90m at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15)[39m [90m at Function.Module._load (internal/modules/cjs/loader.js:864:27)[39m [90m at Module.require (internal/modules/cjs/loader.js:1044:19)[39m [90m at require (internal/modules/cjs/helpers.js:77:18)[39m at Object. (C:\Users\Enriko\Desktop\DiscordMusicBot\Master-Bot\index.js:1:28) [90m at Module._compile (internal/modules/cjs/loader.js:1158:30)[39m [90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)[39m [90m at Module.load (internal/modules/cjs/loader.js:1002:32)[39m [90m at Function.Module._load (internal/modules/cjs/loader.js:901:14)[39m [90m at Function.executeUserEntryPoint as runMain[39m { code: [32m'MODULE_NOT_FOUND'[39m, requireStack: [ [32m'C:\Users\Enriko\Desktop\DiscordMusicBot\Master-Bot\index.js'[39m ] }
Collapse
 
galnir profile image
Nir

It says you didn't install discord.js-commando..

Collapse
 
funndot profile image
FunnDot

can u help me?
import { load } from '@lavaclient/spotify';
^^^^^^
SyntaxError: Cannot use import statement outside a module
at Object.compileFunction (node:vm:352:18)
at wrapSafe (node:internal/modules/cjs/loader:1032:15)
at Module._compile (node:internal/modules/cjs/loader:1067:27)
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
at node:internal/main/run_main_module:17:47

Collapse
 
suprx44 profile image
SupRx44 • Edited

Please Help. I've followed the steps described, but this same error keeps coming up when I run "node index.js".

PS C:\Users[user]\Desktop\Master-Bot> node index.js
node:internal/modules/cjs/loader:936
throw err;
^

Error: Cannot find module 'C:\Users[user]\Desktop\Master-Bot\index.js'
←[90m at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)←[39m
←[90m at Function.Module._load (node:internal/modules/cjs/loader:778:27)←[39m
←[90m at Function.executeUserEntryPoint as runMain←[39m
←[90m at node:internal/main/run_main_module:17:47←[39m {
code: ←[32m'MODULE_NOT_FOUND'←[39m,
requireStack: []
}

I have Node v16.14.2 and Python 2.7. I downloaded LavaLink. Copied the freyacodes application.yml. I made a new Spotify account. I created a MongoDB cluster. I setup my config file with the necessary IDs, tokens, and keys. I spent 3 hours trying to set this up, and what, I'm missing ONE GODDAMN FILE?! Thanks for the help, OP.

Collapse
 
thesenseigamer profile image
Michael Ervin

I'm looking in index.js and there is nothing on line 7 for a client id, where would the client id go now? I'm looking around the code and can't figure out where it would go

Collapse
 
cybermagmadev profile image
cybermagma-dev

Hey When I play some music music it says no perms to join your channel and leaves it pls help

Collapse
 
zaidmaker profile image
DevMirza

Thank you so much 💕 for the this tutorial.

Collapse
 
grantttt profile image
grantttt

did you manage to set up the bot?

Collapse
 
alphaxcoder profile image
AlphaX-coder

Hi i have a question the bot token i put in the in the index.js and cofig.json?

Collapse
 
yizheng5946 profile image
yizheng5946 • Edited

An error occurred while running the command: TypeError: fields.flat is not a function
You shouldn't ever receive an error like this.

why i get this error?

Collapse
 
pforciol profile image
Pierre

Hello ! I am really embarrased because I can't install node-opus... I have Python 2.7, but nothing. Same error as Madmouseked, npm tells me something about node-gyp.

Any idead ? Thank you 😊

Collapse
 
supervoja profile image
Vojislav Sibinovic

Did you ever find a solution? I am having the same problem

Collapse
 
galnir profile image
Nir

If you have python 2.7 and everything that is required installed, the problem is probably about not running the terminal as admin or sudo(if you're using linux based OS).
Try to open the cmd(if windows) as admin, or run "sudo npm i node-opus" if on linux OS

Collapse
 
galnir profile image
Nir

Try to google that specific error, I have no idea what it can be :/

Collapse
 
greenoliv profile image
Greenoliv

How can I install ffmpeg to debian?

Collapse
 
galnir profile image
Nir

sudo apt install ffmpeg

Collapse
 
enigma profile image
Enigma

My bot is online but when I play something It connects, then shows that it is playing music and then it disconnects

Collapse
 
galnir profile image
Nir

Then you must have skipped a step or done something not right, go over the steps again and make sure you install each requirement

Collapse
 
suprx44 profile image
SupRx44 • Edited

THERE IS NO "index.js" IN THE ROOT DIRECTORY. WHY?
ALL THE HELP YOU GIVE US IS "did u install this?"
YEAH! EVERYBODY INSTALLED THE PREREQUISITES AND YOUR CODE IS STILL BUNKASS.

Collapse
 
shivamthakkar profile image
shivamthakkar

stucks at npm install

Collapse
 
galnir profile image
Nir

That's probably a network issue on your end.. all npm does is install packages