Error Trying to Run on Server

Before when I was in VS code running it. It worked perfectly fine but when I move it to a server I get this error.
file:///home/container/source/index.js:1
import { Client, GatewayIntentBits, Collection } from 'discord.js'
^^^^^^^^^^^^^^^^^
SyntaxError: The requested module 'discord.js' does not provide an export named 'GatewayIntentBits'
at ModuleJob._instantiate (node:internal/modules/esm/module_job:134:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:217:5)
at async ModuleLoader.import (node:internal/modules/esm/loader:323:24)
file:///home/container/source/index.js:1
import { Client, GatewayIntentBits, Collection } from 'discord.js'
^^^^^^^^^^^^^^^^^
SyntaxError: The requested module 'discord.js' does not provide an export named 'GatewayIntentBits'
at ModuleJob._instantiate (node:internal/modules/esm/module_job:134:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:217:5)
at async ModuleLoader.import (node:internal/modules/esm/loader:323:24)
4 Replies
d.js toolkit
d.js toolkit5mo ago
Amgelo
Amgelo5mo ago
did you upload your node_modules as well? if yes, you're not supposed to do that delete the folder and reinstall
GhostBear9
GhostBear9OP5mo ago
No But I will delete them And try again That fixed it somehow Thanks
d.js toolkit
d.js toolkit5mo ago
The thread owner has marked this issue as solved.

Did you find this page helpful?