node index problem
wouldnt work :D
everything is same as the link but doesnt work
https://github.com/discordjs/guide/blob/main/code-samples/creating-your-bot/initial-files/index.js
GitHub
guide/code-samples/creating-your-bot/initial-files/index.js at main...
The official guide for discord.js, created and maintained by core members of its community. - discordjs/guide
40 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!
- ā
Marked as resolved by OPat which path are you calling
node index.js
?
is the file structure the same as in the link you sent?Yes
I have index.js under a folder called Z_discord
And the terminal was Users/my name/Z_discord
I think you should've installed the package first ;-;
did i not?
I don't see the node_modules folder
Show the package.json
oh oops
i didnt move it in
\
try running now?
oh wait index.js is empty as well
šµāš«
shows this when i open
oh
well, try running it
iirc a ">" character shows that you entered a multiple line input in powershell
oh no its just the
hm
weird
did you paste the token into config json?
mhm
huh
interesting
{
"token": "..."
}
replace .. with my
token
am i supposed to run in terminal?
or command thingy
command promopt
it doesn't matter, it's pretty much the same
icic
should i restart or something
idk tbh, that's weird that it doesn't run
or is this the problem
doesnt look right to me
the ...
no, i think it's fine
yeah but why is there a ... tho
if index js isnt a folder
vs code refers to it as callbacks, functions, variables, etc
simply put, parts of the code
ohhh icic
is it cuz Z_discord isnt my main file
and im using cd
currently its users/my_name
but i use cd Z_discord
man nvm
i think i found the problem
i closed all the codes and reoponed
and the config file had nothing
yep
is the issue solved?
nope
theres a error here i think
its like highlighted white
require is apparently the error?
FINALLY
IT WORKED
i just launched visual studio code under my file
instead of just opening one by one
š
@shikoshib ty