Problem with a gide

discord.js Guide
Imagine a guide... that explores the many possibilities for your discord.js bot.
6 Replies
d.js docs
d.js docs3y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
anchelte
anchelteOP3y ago
but with this code i am reciving this
anchelte
anchelteOP3y ago
anchelte
anchelteOP3y ago
Discord version -> [email protected] Node version -> v16.6.1
/Users/anchelthe/Desktop/bot-1/node_modules/discord.js/src/util/Util.js:279
if (!Object.hasOwn(given, key) || given[key] === undefined) {
^

TypeError: Object.hasOwn is not a function
at mergeDefault (/Users/anchelthe/Desktop/bot-1/node_modules/discord.js/src/util/Util.js:279:17)
at new BaseClient (/Users/anchelthe/Desktop/bot-1/node_modules/discord.js/src/client/BaseClient.js:25:20)
at new Client (/Users/anchelthe/Desktop/bot-1/node_modules/discord.js/src/client/Client.js:43:5)
at Object.<anonymous> (/Users/anchelthe/Desktop/bot-1/index.js:6:16)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)
at node:internal/main/run_main_module:17:47
/Users/anchelthe/Desktop/bot-1/node_modules/discord.js/src/util/Util.js:279
if (!Object.hasOwn(given, key) || given[key] === undefined) {
^

TypeError: Object.hasOwn is not a function
at mergeDefault (/Users/anchelthe/Desktop/bot-1/node_modules/discord.js/src/util/Util.js:279:17)
at new BaseClient (/Users/anchelthe/Desktop/bot-1/node_modules/discord.js/src/client/BaseClient.js:25:20)
at new Client (/Users/anchelthe/Desktop/bot-1/node_modules/discord.js/src/client/Client.js:43:5)
at Object.<anonymous> (/Users/anchelthe/Desktop/bot-1/index.js:6:16)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)
at node:internal/main/run_main_module:17:47
this is the entire error
chewie
chewie3y ago
update nodejs to at least 16.9.0
anchelte
anchelteOP3y ago
Ok, thanks 🙂

Did you find this page helpful?