Cannot find module "@discordjs/rest"
Whenever I try run any script that calls the discord.js library, I receive the following error:
I've reinstalled discord.js, but to no avail. I'm using the Bun runtime, if that's useful information.
8 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!Not sure we officially support bun. Is there a flag to also install dependencies that you need to set?
I've ran a test instance of djs v14.11 in the past using the Bun runtime, had no issues and don't recall needing to do anything extra to get it working either. Haven't tried any later version of djs though
I've tried it inside node v20.9.0 and I receive the same error, meaning it has nothing to do with the runtime.
How exactly have you installed it? Nobody else is having this issue so it's unlikely to be the package
You don't have a global install or something?
It's installed locally to the project's
node_modules
folder
I might init a fresh NPM project and copy my JS files over. That'll probably solve the problem.Yeah give that a try, definitely seems like something weird in that project
update: it worked
closing the thread now