Coding Global Background
Coding Global

error whenver im using node index.js in cmd

Archived 2 years ago
7 messages
0 members
2 years ago
Open in Discord
4
sam
Verified

i dont know if my script is the problem but i do have a .env and .gitignore and package and everything else but i jst cant get my bot to go online i keep getting this error: const { Client, GatewayIntentBits, MessageAttachment } = await import('discord.js'); ^^^^^ SyntaxError: await is only valid in async functions and the top level bodies of modules at internalCompileFunction (node:internal/vm:77:18) at wrapSafe (node:internal/modules/cjs/loader:1288:20) at Module._compile (node:internal/modules/cjs/loader:1340:27) at Module._extensions..js (node:internal/modules/cjs/loader:1435:10) at Module.load (node:internal/modules/cjs/loader:1207:32) at Module._load (node:internal/modules/cjs/loader:1023:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12) at node:internal/main/run_main_module:28:49 someone help me pls

error whenver im using node index.js in cmd

Replies (7)