zfbx / zdiscord

A Discord bot that runs in FiveM for the purpose of whitelisting, moderation and utilties using discord.js
Other
211 stars 79 forks source link

[BUG] discord.js is not being found #37

Closed MattiVboiii closed 2 years ago

MattiVboiii commented 2 years ago

Describe the bug A clear and concise description of what the bug is.

Whenever I start the script, next error appears

image

Screenshots If applicable, add screenshots to help explain your problem.

image

Information:

Additional context Add any other context about the problem here.

zfbx commented 2 years ago

so you don't actually want to use fivem's latest recommended as it's VERY out of date and doesn't support the version of node zdiscord is built off of you want to use a version that's 4890 or higher (5077)

MattiVboiii commented 2 years ago

still getting the same error mate, "cannot find discord.js"

zfbx commented 2 years ago

do you have yarn installed? here's my version that works confirmed https://cdn.discordapp.com/attachments/862934532110024734/918724690363691038/yarn.zip and do you have any other errors in your console further up that say anything about like a failed build or missing dependencies?

MattiVboiii commented 2 years ago

just used your yarn, now I get this error xD image

zfbx commented 2 years ago

that is certainly a new error for me.. here's what I'd suggest:

first just try restarting the server and see if it works the second time.

If that doesn't work try to clear the server cache and run again, the old yarn remnants might be in there causing trouble.

If neither of those work, let me know and I'll have a few other ideas that are more experimental

MattiVboiii commented 2 years ago

I deleted the yarn-cache folder, didn't do much, same error, now im clearing out the whole server cache

MattiVboiii commented 2 years ago

nope, still crashed image

zfbx commented 2 years ago

okay so let's try this instead.

First the easy way:

download and extract this files into the zdiscord directory zdiscord_modules.zip and start the server.

The harder way:

if you don't already have it, install node.js (*I recommend 16.13.1 LTS) open up the zdiscord folder and type cmd into the top bar (not the search bar) In the command prompt that comes up type npm i and it will install everything you need into that folder. add a file called .yarn.installed (with the dot at the start) in that same directory and run the server, it should skip over yarn completely at that point.

MattiVboiii commented 2 years ago

IT WORKS!

Tysm for your support and patience, you are the best! Script works great on my discord :)

zfbx commented 2 years ago

Glad to hear :) Enjoy, sorry it caused so much of a headache there at the start, hopefully one day fivem will move away from yarn in favor of something better xD or at least update it where it's more stable