Discord Bot Packages Problems

Hey guys, I have a problem I am trying to solve but it’s not working…
I have a discord bot and all my packages don’t want to work.
It occurs when I add a new package to package.json
It says that: Error: Cannot find module ‘discord.js’
When I clearly added it directly to the file and did this cmd:
npm i discord.js
It is also doing it for all the other packages.
If anyone knows how to fix, it would be very appreciated!

Do you have a package.json file? if so send it

This is probably a formatting issue because you added the module to the package.json file directly and npm is having trouble with the formatting. Sending the package.json file would help, but with what you’ve told us this is my recommended solution for now:

  • Delete your package.json file.
  • Go to https://glitch.com/~hello-express and copy over the package.json file to your project.
  • In the future, to add a package, instead of directly editing the package.json file, go to the new package.json file in your project and click Add Package at the way top. Then type the package name and click on it to install it.

@yogurtsyum Is somewhat right, but not right. It is usually another package that interferes with Discord.js. I would recommend removing and adding packages until you found the corrupt one.